fix: allow queue restarting (#3166)

By injecting the cache store into the queue, we allow queues to be
restarted using php flarum queue:restart and similar events dispatched
from within Laravelish classes.
This commit is contained in:
Daniël Klabbers 2021-11-16 16:46:31 +01:00 committed by GitHub
parent e90841624a
commit deff342985

View File

@ -67,7 +67,7 @@ class QueueServiceProvider extends AbstractServiceProvider
/** @var Config $config */
$config = $container->make(Config::class);
return new Worker(
$worker = new Worker(
$container[Factory::class],
$container['events'],
$container[ExceptionHandling::class],
@ -75,6 +75,10 @@ class QueueServiceProvider extends AbstractServiceProvider
return $config->inMaintenanceMode();
}
);
$worker->setCache($container->make('cache.store'));
return $worker;
});
// Override the Laravel native Listener, so that we can ignore the environment