diff options
author | Han-Wen Nienhuys <hanwen@google.com> | 2017-06-22 16:05:19 +0200 |
---|---|---|
committer | Han-Wen Nienhuys <hanwen@google.com> | 2017-06-22 16:05:19 +0200 |
commit | 6d83f5ebfae04717d13cfadda4ca526fd66a5918 (patch) | |
tree | a8feff7fd94a18e5c76b4202176e2964fbd9cb9a | |
parent | 1085b453039b0fe230c3584e0024a7965cc1e323 (diff) |
Avoid using ScheduledThreadPoolExecutor API surface.
Change-Id: Iebed5fb06f45760ce73e47cc203e4bcd8634db8e
-rw-r--r-- | src/main/java/com/googlesource/gerrit/plugins/replication/Destination.java | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/main/java/com/googlesource/gerrit/plugins/replication/Destination.java b/src/main/java/com/googlesource/gerrit/plugins/replication/Destination.java index 0c4bd77..b1d321e 100644 --- a/src/main/java/com/googlesource/gerrit/plugins/replication/Destination.java +++ b/src/main/java/com/googlesource/gerrit/plugins/replication/Destination.java @@ -66,6 +66,7 @@ import java.util.List; import java.util.Map; import java.util.Set; import java.util.concurrent.Callable; +import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.ScheduledThreadPoolExecutor; import java.util.concurrent.TimeUnit; import org.apache.commons.io.FilenameUtils; @@ -88,7 +89,7 @@ public class Destination { private final ProjectControl.Factory projectControlFactory; private final GitRepositoryManager gitManager; private final PermissionBackend permissionBackend; - private volatile ScheduledThreadPoolExecutor pool; + private volatile ScheduledExecutorService pool; private final PerThreadRequestScope.Scoper threadScoper; private final DestinationConfiguration config; private final DynamicItem<EventDispatcher> eventDispatcher; @@ -214,9 +215,8 @@ public class Destination { public int shutdown() { int cnt = 0; if (pool != null) { - for (Runnable r : pool.getQueue()) { - repLog.warn(String.format("Cancelling replication event %s", r)); - } + repLog.warn(String.format("Cancelling replication events")); + cnt = pool.shutdownNow().size(); pool = null; } |