Skip to content

Commit

Permalink
fix: deschedule failed after schedule exception
Browse files Browse the repository at this point in the history
  • Loading branch information
fudongyingluck committed Jul 3, 2023
1 parent eeb86a6 commit dbe886f
Showing 1 changed file with 3 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -119,13 +119,10 @@ public boolean deschedule(String indexName, String id) {
jobInfo.setExpectedPreviousExecutionTime(null);
Scheduler.ScheduledCancellable scheduledCancellable = jobInfo.getScheduledCancellable();

if (scheduledCancellable != null) {
if (scheduledCancellable.cancel()) {
this.scheduledJobInfo.removeJob(indexName, id);
} else {
return false;
}
if (scheduledCancellable != null && scheduledCancellable.cancel() == false) {
return false;
}
this.scheduledJobInfo.removeJob(indexName, id);

return true;
}
Expand Down

0 comments on commit dbe886f

Please sign in to comment.