generated from Nodarx/template
92e85aed47
Signed-off-by: Sebastian Krupinski <krupinski01@gmail.com>
22 lines
786 B
PHP
22 lines
786 B
PHP
<?php
|
|
declare(strict_types=1);
|
|
namespace KTXM\ServiceWopi\Console;
|
|
|
|
use KTXM\ServiceWopi\Host\SessionStore;
|
|
use Symfony\Component\Console\Attribute\AsCommand;
|
|
use Symfony\Component\Console\Command\Command;
|
|
use Symfony\Component\Console\Input\InputInterface;
|
|
use Symfony\Component\Console\Output\OutputInterface;
|
|
|
|
#[AsCommand(name: 'wopi:cleanup', description: 'Remove expired WOPI sessions and discovery cache records')]
|
|
class CleanupCommand extends Command
|
|
{
|
|
public function __construct(private readonly SessionStore $store) { parent::__construct(); }
|
|
protected function execute(InputInterface $input, OutputInterface $output): int
|
|
{
|
|
$this->store->cleanup(time());
|
|
$output->writeln('Expired WOPI records removed.');
|
|
return Command::SUCCESS;
|
|
}
|
|
}
|