Skip to content
This repository was archived by the owner on Feb 26, 2023. It is now read-only.
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Refactor targetTime -> targetTimeMillis
  • Loading branch information
rom1v committed May 22, 2013
commit 75b15167062a43bf83d1f9210d6f95cd1a091528
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ public static abstract class Task implements Runnable {

private String id;
private int delay;
private long targetTime; /* in milliseconds since epoch */
private long targetTimeMillis; /* since epoch */
private String serial;
private boolean executionAsked;
private Future<?> future;
Expand All @@ -258,7 +258,7 @@ public Task(String id, int delay, String serial) {
}
if (delay > 0) {
this.delay = delay;
targetTime = System.currentTimeMillis() + delay;
targetTimeMillis = System.currentTimeMillis() + delay;
}
if (!"".equals(serial)) {
this.serial = serial;
Expand Down Expand Up @@ -291,7 +291,7 @@ private void postExecute() {
if (next != null) {
if (next.delay != 0) {
/* compute remaining delay */
next.delay = Math.max(0, (int) (targetTime - System.currentTimeMillis()));
next.delay = Math.max(0, (int) (targetTimeMillis - System.currentTimeMillis()));
}
/* a task having the same serial was queued, execute it */
BackgroundExecutor.execute(next);
Expand Down