1
0
mirror of https://github.com/flarum/core.git synced 2025-08-01 14:10:37 +02: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:
Daniël Klabbers
2021-11-16 16:46:31 +01:00
committed by GitHub
parent b4a44f70d9
commit 09fdd4cb6d

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