Reused ProcessVisitsCommand name as the lock name

This commit is contained in:
Alejandro Celaya 2018-11-17 14:16:45 +01:00
parent 1ceabf3bc3
commit dd2cffeee9

View File

@ -21,7 +21,6 @@ use function sprintf;
class ProcessVisitsCommand extends Command class ProcessVisitsCommand extends Command
{ {
public const NAME = 'visit:process'; public const NAME = 'visit:process';
private const LOCK_NAME = 'visit_process';
/** /**
* @var VisitServiceInterface * @var VisitServiceInterface
@ -69,7 +68,7 @@ class ProcessVisitsCommand extends Command
$this->output = $output; $this->output = $output;
$io = new SymfonyStyle($input, $output); $io = new SymfonyStyle($input, $output);
$lock = $this->locker->createLock(self::LOCK_NAME); $lock = $this->locker->createLock(self::NAME);
if (! $lock->acquire()) { if (! $lock->acquire()) {
$io->warning(sprintf( $io->warning(sprintf(
$this->translator->translate('There is already an instance of the "%s" command in execution'), $this->translator->translate('There is already an instance of the "%s" command in execution'),