This commit is contained in:
2021-11-30 14:43:55 +08:00
parent a1bf157408
commit 5a9f9da347
+1 -2
View File
@@ -36,8 +36,7 @@ class AsyncTask
public function execute(OnTaskInterface|string $handler, array $params = [], int $workerId = null)
{
if ($workerId === null || $workerId <= $this->server->setting['worker_num']) {
$workerId = random_int($this->server->setting['worker_num'] + 1,
$this->server->setting['worker_num'] + 1 + $this->server->setting['task_worker_num']);
$workerId = random_int($this->server->setting['worker_num'] + 1, $this->server->setting['task_worker_num']);
}
if (is_string($handler)) {
$handler = $this->handle($handler, $params);