mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-11 16:05:44 +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:
2
gradle/changelog/single_working_copy_pool.yaml
Normal file
2
gradle/changelog/single_working_copy_pool.yaml
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
- type: fixed
|
||||||
|
description: Prevent multiple working copy pools ([#1797](https://github.com/scm-manager/scm-manager/issues/1797))
|
||||||
@@ -34,6 +34,7 @@ import org.slf4j.LoggerFactory;
|
|||||||
import sonia.scm.util.IOUtil;
|
import sonia.scm.util.IOUtil;
|
||||||
|
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
|
import javax.inject.Singleton;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.util.LinkedHashMap;
|
import java.util.LinkedHashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
@@ -81,6 +82,7 @@ import static java.util.Optional.of;
|
|||||||
* <li>Wait for a cached directory on parallel requests</li>
|
* <li>Wait for a cached directory on parallel requests</li>
|
||||||
* </ul>
|
* </ul>
|
||||||
*/
|
*/
|
||||||
|
@Singleton
|
||||||
public class SimpleCachingWorkingCopyPool implements WorkingCopyPool {
|
public class SimpleCachingWorkingCopyPool implements WorkingCopyPool {
|
||||||
|
|
||||||
public static final int DEFAULT_WORKING_COPY_POOL_SIZE = 5;
|
public static final int DEFAULT_WORKING_COPY_POOL_SIZE = 5;
|
||||||
|
|||||||
Reference in New Issue
Block a user