Skip to content

Commit 5061c8c

Browse files
ESalfingeraryaantony92
authored andcommitted
fix(newsletter-sync): fixed implementation of lockable trait
1 parent bce18c7 commit 5061c8c

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/Newsletter/Command/NewsletterSyncCommand.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,11 @@ protected function execute(InputInterface $input, OutputInterface $output)
8989
if ($input->getOption('customer-data-sync') || $input->getOption('all-customers')) {
9090
$lockKey = 'plugin_cmf_newsletter_sync_queue';
9191

92-
$this->lock($lockKey);
92+
if (!$this->lock($lockKey)) {
93+
$output->writeln('The command is already running in another process.');
94+
95+
return 0;
96+
}
9397

9498
if (!$input->getOption('force-segments')) {
9599
$this->newsletterManager->syncSegments();

0 commit comments

Comments
 (0)