Skip to content

Commit

Permalink
Merge branch '3.9' of https://github.com/JumpMind/symmetric-ds.git in…
Browse files Browse the repository at this point in the history
…to 3.9
  • Loading branch information
jumpmind-josh committed Mar 23, 2018
2 parents 49a9c50 + 6dc4022 commit 2365ed2
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,15 @@ protected Map<String, Long> getBiggestBatchIds(List<BatchId> batches) {

@Override
public long clean(long ttlInMs) {
if (!engine.getClusterService().lock(ClusterConstants.STAGE_MANAGEMENT)) {
log.debug("Could not get a lock to run stage management");
return 0;
try {
if (!engine.getClusterService().lock(ClusterConstants.STAGE_MANAGEMENT)) {
log.debug("Could not get a lock to run stage management");
return 0;
}
} catch (Exception e) {
// during setup or un-install, it's possible sym_lock table isn't available yet
}

try {
boolean purgeBasedOnTTL = engine.getParameterService().is(ParameterConstants.STREAM_TO_FILE_PURGE_ON_TTL_ENABLED, false);
if (purgeBasedOnTTL) {
Expand All @@ -51,7 +55,10 @@ public long clean(long ttlInMs) {
}
}
} finally {
engine.getClusterService().unlock(ClusterConstants.STAGE_MANAGEMENT);
try {
engine.getClusterService().unlock(ClusterConstants.STAGE_MANAGEMENT);
} catch (Exception e) {
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
import java.util.Date;
import java.util.List;

import org.apache.commons.lang.time.DateUtils;
import org.apache.log4j.PatternLayout;
import org.jumpmind.symmetric.AbstractSymmetricEngine;
import org.jumpmind.symmetric.ISymmetricEngine;
Expand Down

0 comments on commit 2365ed2

Please sign in to comment.