Skip to content

Commit

Permalink
fix cancel task
Browse files Browse the repository at this point in the history
  • Loading branch information
wangtaohz committed Dec 13, 2023
1 parent acb6087 commit cae0414
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -381,11 +381,10 @@ public Status getStatus() {
public void close() {
lock.lock();
try {
clearProcess(this);
taskMap.values().forEach(TaskRuntime::tryCanceling);
this.status = OptimizingProcess.Status.CLOSED;
this.endTime = System.currentTimeMillis();
persistProcessCompleted(false);
clearProcess(this);
} finally {
lock.unlock();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ private Set<Status> getNext() {
}

public synchronized boolean tryAccepting(Status targetStatus) {
if (owner.isClosed() || !getNext().contains(targetStatus)) {
if (!getNext().contains(targetStatus)) {
return false;
}
status = targetStatus;
Expand Down

0 comments on commit cae0414

Please sign in to comment.