Skip to content

Commit

Permalink
replace sync with blocking since theres no sync
Browse files Browse the repository at this point in the history
  • Loading branch information
Tofaa2 committed Jul 8, 2024
1 parent adff2d1 commit 0c66a95
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,7 @@ private void handleTask(TaskImpl task) {
TaskSchedule schedule = task.task.get();
if (schedule instanceof TaskSchedule.DurationSchedule) {
TaskSchedule.DurationSchedule d = (TaskSchedule.DurationSchedule) schedule;
SCHEDULED_EXECUTOR.schedule(() -> {
safeExecute(task);
}, d.duration.toMillis(), TimeUnit.MILLISECONDS);
SCHEDULED_EXECUTOR.schedule(() -> safeExecute(task), d.duration.toMillis(), TimeUnit.MILLISECONDS);
}
else if (schedule instanceof TaskSchedule.FutureSchedule) {
TaskSchedule.FutureSchedule f = (TaskSchedule.FutureSchedule) schedule;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class Builder {
private final Runnable runnable;
private final Scheduler scheduler;

private ExecutionType executionType = ExecutionType.SYNC;//default
private ExecutionType executionType = ExecutionType.BLOCKING;//default
private TaskSchedule delay = TaskSchedule.immediate();
private TaskSchedule repeat = TaskSchedule.stop();

Expand Down

0 comments on commit 0c66a95

Please sign in to comment.