Add command to reset hub jo count in redis. #543

This commit is contained in:
Korina Cordero 2021-03-16 08:19:20 +00:00
parent 50e15cd770
commit c69a18d89b

View file

@ -0,0 +1,39 @@
<?php
namespace App\Command;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use App\Service\RedisClientProvider;
class ResetHubJoCountCommand extends Command
{
protected $redis;
public function __construct(RedisClientProvider $redis)
{
$this->redis = $redis->getRedisClient();
parent::__construct();
}
protected function configure()
{
$this->setName('hub:jo:reset')
->setDescription('Reset hub\'s job order count')
->setHelp('Reset hub\'s job order count');
}
protected function execute(InputInterface $input, OutputInterface $output)
{
$key = 'hub_jo_count';
$this->redis->del($key);
return 0;
}
}