1
0
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:
Daniël Klabbers
2020-10-09 22:06:28 +02:00
committed by GitHub
parent a0c36a015b
commit 2b1581875a
3 changed files with 43 additions and 70 deletions

View 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();
}
}