2021-10-26 16:53:04 +03:00
|
|
|
<?php
|
|
|
|
|
|
|
|
declare(strict_types=1);
|
|
|
|
/**
|
2024-07-02 18:54:16 +03:00
|
|
|
* SPDX-FileCopyrightText: 2021 Nextcloud GmbH and Nextcloud contributors
|
|
|
|
* SPDX-License-Identifier: AGPL-3.0-or-later
|
2021-10-26 16:53:04 +03:00
|
|
|
*/
|
|
|
|
|
|
|
|
namespace OCA\NotifyPush\Command;
|
|
|
|
|
|
|
|
use OCA\NotifyPush\Queue\IQueue;
|
|
|
|
use Symfony\Component\Console\Command\Command;
|
|
|
|
use Symfony\Component\Console\Input\InputInterface;
|
|
|
|
use Symfony\Component\Console\Output\OutputInterface;
|
|
|
|
|
|
|
|
class Reset extends Command {
|
|
|
|
private $queue;
|
|
|
|
|
|
|
|
public function __construct(
|
|
|
|
IQueue $queue
|
|
|
|
) {
|
|
|
|
parent::__construct();
|
|
|
|
$this->queue = $queue;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @return void
|
|
|
|
*/
|
2024-01-17 18:57:54 +03:00
|
|
|
protected function configure(): void {
|
2021-10-26 16:53:04 +03:00
|
|
|
$this
|
|
|
|
->setName('notify_push:reset')
|
|
|
|
->setDescription('Cancel all active connections to the push server');
|
|
|
|
parent::configure();
|
|
|
|
}
|
|
|
|
|
2024-01-17 18:57:54 +03:00
|
|
|
protected function execute(InputInterface $input, OutputInterface $output): int {
|
2021-10-26 16:53:04 +03:00
|
|
|
$this->queue->push("notify_signal", "reset");
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
}
|