mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-04 20:45:52 +01:00
Prevent multiple instances of working copy pool (#1797)
The working copy pool has to be a singleton, because otherwise there could be multiple instances with their own caches and therefore no reuse and maybe more relevant working directories that will never be deleted.
This commit is contained in:
@@ -34,6 +34,7 @@ import org.slf4j.LoggerFactory;
|
||||
import sonia.scm.util.IOUtil;
|
||||
|
||||
import javax.inject.Inject;
|
||||
import javax.inject.Singleton;
|
||||
import java.io.File;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Map;
|
||||
@@ -81,6 +82,7 @@ import static java.util.Optional.of;
|
||||
* <li>Wait for a cached directory on parallel requests</li>
|
||||
* </ul>
|
||||
*/
|
||||
@Singleton
|
||||
public class SimpleCachingWorkingCopyPool implements WorkingCopyPool {
|
||||
|
||||
public static final int DEFAULT_WORKING_COPY_POOL_SIZE = 5;
|
||||
|
||||
Reference in New Issue
Block a user