From 06a734a30ad0bdac418ec07ff75c25432aa9d06f Mon Sep 17 00:00:00 2001 From: huangzhhui Date: Thu, 27 Dec 2018 16:39:21 +0800 Subject: [PATCH] Added a gap just in case the sleeping workers got the lock --- src/framework/src/Bootstrap/WorkerStartCallback.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/framework/src/Bootstrap/WorkerStartCallback.php b/src/framework/src/Bootstrap/WorkerStartCallback.php index 6124b30c3..35b831301 100644 --- a/src/framework/src/Bootstrap/WorkerStartCallback.php +++ b/src/framework/src/Bootstrap/WorkerStartCallback.php @@ -44,6 +44,7 @@ class WorkerStartCallback // Only running in one worker. $this->logger->debug("Worker $lockedWorkerId got the lock."); // @TODO Do something that you want only one worker do. + sleep(1); $lock->unlock(); $atomic->wakeup($server->setting['worker_num'] - 1); } else {