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:
René Pfeuffer
2021-09-06 08:40:22 +02:00
committed by GitHub
parent 856315a15f
commit 13d72d45c6
2 changed files with 4 additions and 0 deletions

View File

@@ -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;