mirror of
https://github.com/flarum/framework.git
synced 2025-02-02 14:41:01 +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
b4a44f70d9
commit
09fdd4cb6d
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue
Block a user