mirror of
https://github.com/flarum/framework.git
synced 2024-11-25 09:41:49 +08:00
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:
parent
e90841624a
commit
deff342985
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue
Block a user