Fix timer task cancellation
@@ -307,7 +307,8 @@ public class OTransactionPhase1Task extends OAbstractReplicatedTask {
@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(() -> {
@@ -317,8 +318,8 @@ public class OTransactionPhase1Task extends OAbstractReplicatedTask {
}
});
}
- };
- Orient.instance().scheduleTask(notYetFinishedTask, getDistributedTimeout(), getDistributedTimeout());
+ }, getDistributedTimeout(), getDistributedTimeout());
}
}
+
}
