mirror of
https://github.com/flarum/core.git
synced 2025-08-03 06:57:54 +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:
@@ -67,7 +67,7 @@ class QueueServiceProvider extends AbstractServiceProvider
|
|||||||
/** @var Config $config */
|
/** @var Config $config */
|
||||||
$config = $container->make(Config::class);
|
$config = $container->make(Config::class);
|
||||||
|
|
||||||
return new Worker(
|
$worker = new Worker(
|
||||||
$container[Factory::class],
|
$container[Factory::class],
|
||||||
$container['events'],
|
$container['events'],
|
||||||
$container[ExceptionHandling::class],
|
$container[ExceptionHandling::class],
|
||||||
@@ -75,6 +75,10 @@ class QueueServiceProvider extends AbstractServiceProvider
|
|||||||
return $config->inMaintenanceMode();
|
return $config->inMaintenanceMode();
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
$worker->setCache($container->make('cache.store'));
|
||||||
|
|
||||||
|
return $worker;
|
||||||
});
|
});
|
||||||
|
|
||||||
// Override the Laravel native Listener, so that we can ignore the environment
|
// Override the Laravel native Listener, so that we can ignore the environment
|
||||||
|
Reference in New Issue
Block a user