diff options
Diffstat (limited to 'src/main/java/com/googlesource/gerrit/plugins/replication/PushOne.java')
-rw-r--r-- | src/main/java/com/googlesource/gerrit/plugins/replication/PushOne.java | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/main/java/com/googlesource/gerrit/plugins/replication/PushOne.java b/src/main/java/com/googlesource/gerrit/plugins/replication/PushOne.java index 7682f70..473ebc5 100644 --- a/src/main/java/com/googlesource/gerrit/plugins/replication/PushOne.java +++ b/src/main/java/com/googlesource/gerrit/plugins/replication/PushOne.java @@ -107,6 +107,7 @@ class PushOne implements ProjectRunnable, CanceledWhileRunning { private Repository git; private boolean retrying; private int retryCount; + private final int maxRetries; private boolean canceled; private final ListMultimap<String, ReplicationState> stateMap = LinkedListMultimap.create(); private final int maxLockRetries; @@ -152,6 +153,7 @@ class PushOne implements ProjectRunnable, CanceledWhileRunning { createdAt = System.nanoTime(); metrics = m; canceledWhileRunning = new AtomicBoolean(false); + maxRetries = p.getMaxRetries(); } @Override @@ -196,9 +198,10 @@ class PushOne implements ProjectRunnable, CanceledWhileRunning { return retrying; } - void setToRetry() { + boolean setToRetry() { retrying = true; retryCount++; + return retryCount <= maxRetries; } void canceledByReplication() { |