Skip to content

Commit

Permalink
Make Scheduler AutoClosable
Browse files Browse the repository at this point in the history
  • Loading branch information
mintdaniel42 committed Oct 26, 2024
1 parent 8306ced commit 9ab1a62
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 9ab1a62

Please sign in to comment.