Skip to content

Commit

Permalink
Fix timer task cancellation
Browse files Browse the repository at this point in the history
  • Loading branch information
wolf4ood committed Dec 16, 2019
1 parent 313c02b commit 2f3d5d8
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,8 @@ public List<ORecordOperation> getOps() {
@Override
public void received(ODistributedRequest request, ODistributedDatabase distributedDatabase) {
if (notYetFinishedTask == null) {
notYetFinishedTask = new TimerTask() {

notYetFinishedTask = Orient.instance().scheduleTask(new Runnable() {
@Override
public void run() {
Orient.instance().submit(() -> {
Expand All @@ -292,8 +293,8 @@ public void run() {
}
});
}
};
Orient.instance().scheduleTask(notYetFinishedTask, getDistributedTimeout(), getDistributedTimeout());
}, getDistributedTimeout(), getDistributedTimeout());
}
}

}

0 comments on commit 2f3d5d8

Please sign in to comment.