mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-06 03:47:16 +00:00
AsyncPool: do not double-check progress updates on finished tasks
checkProgressUpdates is called directly before onCompletion, so we only need to call it again if the task isn't finished yet.
This commit is contained in:
parent
008a022ec1
commit
5a0cde49cc
@ -247,7 +247,6 @@ class AsyncPool{
|
||||
while(!$queue->isEmpty()){
|
||||
/** @var AsyncTask $task */
|
||||
$task = $queue->bottom();
|
||||
$task->checkProgressUpdates();
|
||||
if($task->isFinished()){ //make sure the task actually executed before trying to collect
|
||||
$queue->dequeue();
|
||||
|
||||
@ -268,6 +267,7 @@ class AsyncPool{
|
||||
$task->onCompletion();
|
||||
}
|
||||
}else{
|
||||
$task->checkProgressUpdates();
|
||||
$more = true;
|
||||
break; //current task is still running, skip to next worker
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user