Merge pull request #4119 from nextcloud/enh/4097/job-check-bridges

Job to check Matterbridge processes
This commit is contained in:
Joas Schilling 2020-09-07 16:25:04 +02:00 коммит произвёл GitHub
Родитель a64f20a265 6817e70906
Коммит 7afff3b3e6
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
5 изменённых файлов: 61 добавлений и 3 удалений

Просмотреть файл

@ -56,6 +56,7 @@ And in the works for the [coming versions](https://github.com/nextcloud/spreed/m
<job>OCA\Talk\BackgroundJob\ResetAssignedSignalingServer</job>
<job>OCA\Talk\BackgroundJob\CheckReferenceIdColumn</job>
<job>OCA\Talk\BackgroundJob\CheckHostedSignalingServer</job>
<job>OCA\Talk\BackgroundJob\CheckMatterbridges</job>
</background-jobs>
<repair-steps>

Просмотреть файл

@ -0,0 +1,57 @@
<?php
declare(strict_types=1);
/**
* @copyright Copyright (c) 2020 Julien Veyssier <eneiluj@posteo.net>
*
* @license GNU AGPL version 3 or any later version
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
namespace OCA\Talk\BackgroundJob;
use OCP\BackgroundJob\TimedJob;
use OCA\Talk\MatterbridgeManager;
use Psr\Log\LoggerInterface;
/**
* Class CheckMatterbridges
*
* @package OCA\Talk\BackgroundJob
*/
class CheckMatterbridges extends TimedJob {
/** @var MatterbridgeManager */
protected $bridgeManager;
/** @var LoggerInterface */
protected $logger;
public function __construct(MatterbridgeManager $bridgeManager,
LoggerInterface $logger) {
// Every 15 minutes
$this->setInterval(60 * 15);
$this->bridgeManager = $bridgeManager;
$this->logger = $logger;
}
protected function run($argument): void {
$this->bridgeManager->checkAllBridges();
$this->bridgeManager->killZombieBridges();
$this->logger->info('Checked if Matterbridge instances are running correctly.');
}
}

Просмотреть файл

@ -23,7 +23,7 @@ declare(strict_types=1);
namespace OCA\Talk\BackgroundJob;
use OC\BackgroundJob\TimedJob;
use OCP\BackgroundJob\TimedJob;
use OCA\Talk\Signaling\Messages;
/**

Просмотреть файл

@ -23,7 +23,7 @@ declare(strict_types=1);
namespace OCA\Talk\BackgroundJob;
use OC\BackgroundJob\TimedJob;
use OCP\BackgroundJob\TimedJob;
use OCA\Talk\Manager;
use OCA\Talk\Room;
use Psr\Log\LoggerInterface;

Просмотреть файл

@ -23,7 +23,7 @@ declare(strict_types=1);
namespace OCA\Talk\BackgroundJob;
use OC\BackgroundJob\TimedJob;
use OCP\BackgroundJob\TimedJob;
use OCA\Talk\Manager;
use OCP\ICache;
use OCP\ICacheFactory;