From 15bd214be27426ed251e916700c23ca396bb335c Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Wed, 21 Mar 2018 20:23:16 -0700 Subject: [PATCH] check pid --- src/Illuminate/Console/Scheduling/CallbackEvent.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/Illuminate/Console/Scheduling/CallbackEvent.php b/src/Illuminate/Console/Scheduling/CallbackEvent.php index 10286beae449..1b54a1aaf7ec 100644 --- a/src/Illuminate/Console/Scheduling/CallbackEvent.php +++ b/src/Illuminate/Console/Scheduling/CallbackEvent.php @@ -60,8 +60,12 @@ public function run(Container $container) return; } - register_shutdown_function(function () { - $this->removeMutex(); + $pid = getmypid(); + + register_shutdown_function(function () use ($pid) { + if ($pid === getmypid()) { + $this->removeMutex(); + } }); parent::callBeforeCallbacks($container);