AsyncPool: silence a warning about wrong key type

getTaskId() returns int|null, although it won't happen after the ID has been set.
This commit is contained in:
Dylan K. Taylor 2020-04-15 12:40:23 +01:00
parent bc985198a0
commit 5571ae05b5

View File

@ -162,13 +162,14 @@ class AsyncPool{
} }
$task->progressUpdates = new \Threaded; $task->progressUpdates = new \Threaded;
$task->setTaskId($this->nextTaskId++); $taskId = $this->nextTaskId++;
$task->setTaskId($taskId);
$this->tasks[$task->getTaskId()] = $task; $this->tasks[$taskId] = $task;
$this->getWorker($worker)->stack($task); $this->getWorker($worker)->stack($task);
$this->workerUsage[$worker]++; $this->workerUsage[$worker]++;
$this->taskWorkers[$task->getTaskId()] = $worker; $this->taskWorkers[$taskId] = $worker;
$this->workerLastUsed[$worker] = time(); $this->workerLastUsed[$worker] = time();
} }