This commit is contained in:
2021-08-13 14:37:46 +08:00
parent de4e63d7f9
commit 15851ba97c
2 changed files with 35 additions and 23 deletions
+3 -2
View File
@@ -379,10 +379,11 @@ class ServerManager
/**
* @param TaskExecute|string $handler
* @param array $params
* @param int $workerId
* @param int|null $workerId
* @throws ReflectionException
* @throws Exception
*/
public function task(TaskExecute|string $handler, array $params = [], int $workerId = 0)
public function task(TaskExecute|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,