Skip to content

Commit

Permalink
Switch cleanup delay to using long instead of int everywhere, to avoi…
Browse files Browse the repository at this point in the history
…d overflow issues for long delays in milliseconds (#1498)
  • Loading branch information
bbpennel authored Dec 7, 2022
1 parent 847fb7d commit b2d80f5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ public class CleanupDepositJob extends AbstractDepositJob {

private IngestSourceManager sourceManager;

// Redis expects to receive ints for its delays
private int statusKeysExpireSeconds;

public CleanupDepositJob() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,28 +144,28 @@ private Client makeJesqueClient() {

private long actionMonitorDelay = 1000l;

private int cleanupDelaySeconds;
private long cleanupDelaySeconds;

private int unavailableDelaySeconds;
private long unavailableDelaySeconds;

private boolean isQuieted;

// Visible for testing
protected ActionMonitoringTask actionMonitoringTask;

public int getCleanupDelaySeconds() {
public long getCleanupDelaySeconds() {
return cleanupDelaySeconds;
}

public void setCleanupDelaySeconds(int cleanupDelaySeconds) {
public void setCleanupDelaySeconds(long cleanupDelaySeconds) {
this.cleanupDelaySeconds = cleanupDelaySeconds;
}

public int getUnavailableDelaySeconds() {
public long getUnavailableDelaySeconds() {
return unavailableDelaySeconds;
}

public void setUnavailableDelaySeconds(int unavailableDelaySeconds) {
public void setUnavailableDelaySeconds(long unavailableDelaySeconds) {
this.unavailableDelaySeconds = unavailableDelaySeconds;
}

Expand Down Expand Up @@ -882,7 +882,7 @@ private void queueNextJob(Job job, String depositUUID, Map<String, String> statu
Job cleanJob = makeJob(CleanupDepositJob.class, depositUUID);
LOG.info("Queuing {} for deposit {}",
cleanJob.getClassName(), depositUUID);
enqueueJob(cleanJob, status, 1000 * this.getCleanupDelaySeconds());
enqueueJob(cleanJob, status, 1000l * this.getCleanupDelaySeconds());
}
}

Expand Down

0 comments on commit b2d80f5

Please sign in to comment.