mirror of
https://github.com/flarum/core.git
synced 2025-10-13 07:54:25 +02:00
Fixes the queue for beta 14 (#2363)
- rewrite the queue handling for illuminate 6+ - implement missing maintenance mode callable for queue Worker - Ensure we resolve append the queue commands once the queue bindings are loaded - Override WorkCommand because it needs the maintenance flag. It tries to use the isDownForMaintenance method from the Container assuming it is a Laravel Application. Circumvented this issue by resolving our Config from IOC instead.
This commit is contained in:
27
src/Queue/Console/WorkCommand.php
Normal file
27
src/Queue/Console/WorkCommand.php
Normal file
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Flarum.
|
||||
*
|
||||
* For detailed copyright and license information, please view the
|
||||
* LICENSE file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Flarum\Queue\Console;
|
||||
|
||||
use Flarum\Foundation\Config;
|
||||
|
||||
class WorkCommand extends \Illuminate\Queue\Console\WorkCommand
|
||||
{
|
||||
protected function downForMaintenance()
|
||||
{
|
||||
if ($this->option('force')) {
|
||||
return false;
|
||||
}
|
||||
|
||||
/** @var Config $config */
|
||||
$config = $this->laravel->make(Config::class);
|
||||
|
||||
return $config->inMaintenanceMode();
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user