This commit is contained in:
2020-09-11 15:01:22 +08:00
parent 48e2580c8f
commit 3bbd3e7c4e
6 changed files with 27 additions and 13 deletions
+3 -4
View File
@@ -116,19 +116,18 @@ class Queue extends \Snowflake\Process\Process
*/
private function runner(string $class)
{
$logger = $this->application->getLogger();
try {
$rely_on = unserialize($class);
$this->waiting->del($rely_on);
$this->waiting->del($class);
if (!($rely_on instanceof Consumer)) {
return;
}
$this->running->add($rely_on);
$rely_on->onRunning();
} catch (\Throwable $exception) {
$logger->write($exception->getMessage(), 'queue');
logger()->write($exception->getMessage(), 'queue');
} finally {
$this->running->del($rely_on);
$this->running->del($class);
if (isset($rely_on) && $rely_on instanceof Consumer) {
$rely_on->onComplete();
$this->complete->add($rely_on);