diff --git a/src/Worker.php b/src/Worker.php index 817d017..fd69b56 100644 --- a/src/Worker.php +++ b/src/Worker.php @@ -296,6 +296,11 @@ protected function handleUniqueJob(CommandInterface $command): void protected function processJob(JobInterface $job): void { + // If we are shutting down, ignore the job, we likely already unregistered the function + if ($this->shutdownPromise !== null) { + return; + } + if (!isset($this->functions[$job->getFunction()])) { throw new LogicException("Got job for unknown function {$job->getFunction()}"); }