Add command to reset hub jo count in redis. #543
This commit is contained in:
parent
50e15cd770
commit
c69a18d89b
1 changed files with 39 additions and 0 deletions
39
src/Command/ResetHubJoCountCommand.php
Normal file
39
src/Command/ResetHubJoCountCommand.php
Normal 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;
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue