Skip to content

Commit

Permalink
Merge pull request #30 from mintdaniel42/master
Browse files Browse the repository at this point in the history
Make Scheduler AutoClosable
  • Loading branch information
amanteaux authored Nov 7, 2024
2 parents 8bfff70 + 7b7cab8 commit 0997e93
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/main/java/com/coreoz/wisp/Scheduler.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
* A job is executed only once at a time.
* The scheduler will never execute the same job twice at a time.
*/
public final class Scheduler {
public final class Scheduler implements AutoCloseable {
private static final Logger logger = LoggerFactory.getLogger(Scheduler.class);

/**
Expand Down Expand Up @@ -516,4 +516,9 @@ private void runJob(Job jobToRun) {
scheduleNextExecution(jobToRun);
}
}

@Override
public void close() {
gracefullyShutdown();
}
}

0 comments on commit 0997e93

Please sign in to comment.