From cbc4a2462032f10ff6943fc39fd8284bc0811376 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Fri, 27 Nov 2020 14:38:17 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- System/Snowflake.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/System/Snowflake.php b/System/Snowflake.php index 35442f38..0e418de7 100644 --- a/System/Snowflake.php +++ b/System/Snowflake.php @@ -269,9 +269,7 @@ class Snowflake return; } - $task_num = $server->setting['task_worker_num'] - 1; - - $randWorkerId = random_int(1, $task_num); + $randWorkerId = random_int(0, $server->setting['task_worker_num'] - 1); /** @var Task $class */ $class = static::createObject($class);