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);