diff options
Diffstat (limited to 'src/com/gitblit/GCExecutor.java')
-rw-r--r-- | src/com/gitblit/GCExecutor.java | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/com/gitblit/GCExecutor.java b/src/com/gitblit/GCExecutor.java index 243cbb92..312baf5b 100644 --- a/src/com/gitblit/GCExecutor.java +++ b/src/com/gitblit/GCExecutor.java @@ -53,6 +53,8 @@ public class GCExecutor implements Runnable { private final IStoredSettings settings;
+ private AtomicBoolean running = new AtomicBoolean(false);
+
private AtomicBoolean forceClose = new AtomicBoolean(false);
private final Map<String, GCStatus> gcCache = new ConcurrentHashMap<String, GCStatus>();
@@ -70,6 +72,10 @@ public class GCExecutor implements Runnable { return settings.getBoolean(Keys.git.enableGarbageCollection, false);
}
+ public boolean isRunning() {
+ return running.get();
+ }
+
public boolean lock(String repositoryName) {
return setGCStatus(repositoryName, GCStatus.COLLECTING);
}
@@ -121,6 +127,8 @@ public class GCExecutor implements Runnable { if (!isReady()) {
return;
}
+
+ running.set(true);
Date now = new Date();
for (String repositoryName : GitBlit.self().getRepositoryList()) {
@@ -205,6 +213,8 @@ public class GCExecutor implements Runnable { logger.debug(MessageFormat.format("GCExecutor released GC lock for {0}", repositoryName));
}
}
+
+ running.set(false);
}
private boolean isRepositoryIdle(FileRepository repository) {
|