Skip to content

Commit

Permalink
Update CacheMaintainer to be a generic ScheduledExecutor class that c…
Browse files Browse the repository at this point in the history
…an accept a Runnable and an interval

Signed-off-by: owenhalpert <[email protected]>
  • Loading branch information
owenhalpert committed Dec 4, 2024
1 parent 601a24a commit 558e7ea
Showing 1 changed file with 1 addition and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@

/**
* Executes a task periodically
*/
public class ScheduledExecutor implements Closeable {
private final ScheduledExecutorService executor;
Expand All @@ -25,12 +24,7 @@ public class ScheduledExecutor implements Closeable {
public ScheduledExecutor(Runnable task, long scheduleMillis) {
this.task = task;
this.executor = Executors.newSingleThreadScheduledExecutor();
executor.scheduleAtFixedRate(
task,
0,
scheduleMillis,
TimeUnit.MILLISECONDS
);
executor.scheduleAtFixedRate(task, 0, scheduleMillis, TimeUnit.MILLISECONDS);
}

@Override
Expand Down

0 comments on commit 558e7ea

Please sign in to comment.