Skip to content

Commit

Permalink
[Messenger] Fix exiting FailedMessagesRetryCommand
Browse files Browse the repository at this point in the history
  • Loading branch information
HypeMC committed Sep 29, 2023
1 parent 9cbdd32 commit 567cafc
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
10 changes: 10 additions & 0 deletions DependencyInjection/FrameworkExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -2098,6 +2098,16 @@ private function registerMessengerConfiguration(array $config, ContainerBuilder
$container->getDefinition('messenger.transport.beanstalkd.factory')->addTag('messenger.transport_factory');
}

if ($config['stop_worker_on_signals'] && $this->hasConsole()) {
$container->getDefinition('console.command.messenger_consume_messages')
->replaceArgument(8, $config['stop_worker_on_signals']);
$container->getDefinition('console.command.messenger_failed_messages_retry')
->replaceArgument(6, $config['stop_worker_on_signals']);
}

if ($this->hasConsole() && $container->hasDefinition('messenger.listener.stop_worker_signals_listener')) {
$container->getDefinition('messenger.listener.stop_worker_signals_listener')->clearTag('kernel.event_subscriber');
}
if ($config['stop_worker_on_signals']) {
$container->getDefinition('messenger.listener.stop_worker_signals_listener')->replaceArgument(0, $config['stop_worker_on_signals']);
}
Expand Down
2 changes: 2 additions & 0 deletions Resources/config/console.php
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@
service('messenger.listener.reset_services')->nullOnInvalid(),
[], // Bus names
service('messenger.rate_limiter_locator')->nullOnInvalid(),
null,
])
->tag('console.command')
->tag('monolog.logger', ['channel' => 'messenger'])
Expand Down Expand Up @@ -194,6 +195,7 @@
service('event_dispatcher'),
service('logger')->nullOnInvalid(),
service('messenger.transport.native_php_serializer')->nullOnInvalid(),
null,
])
->tag('console.command')
->tag('monolog.logger', ['channel' => 'messenger'])
Expand Down

0 comments on commit 567cafc

Please sign in to comment.