Skip to content

Commit 013bbcc

Browse files
committed
minor symfony#38303 [Messenger] Fix misleading comment about time-limit (sylfabre)
This PR was merged into the 5.2-dev branch. Discussion ---------- [Messenger] Fix misleading comment about time-limit | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | no | Deprecations? | no | Tickets | n/a | License | MIT | Doc PR | n/a The current explanation of the time-limit option of the `messenger:consume` command is misleading as it lets you think that this is an enforced hard limit. For instance, you may think that a command started with `--time-limit=10` will stop once 10 seconds are elapsed, no matter what. Actually, two things happen: - Once 10 seconds have elapsed, then the worker won't receive and handle any other message - The worker will keep running until the currently handled message is fully handled so it can last way longer than 10 seconds, then it will stop. I'm not sure this is behavior is actually a bug or not, but the current documentation does not describe the current behavior Commits ------- 2117664 [Messenger] Fix misleading comment about time-limit
2 parents ffb7f0e + 2117664 commit 013bbcc

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Symfony/Component/Messenger/Command/ConsumeMessagesCommand.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ protected function configure(): void
6767
new InputOption('limit', 'l', InputOption::VALUE_REQUIRED, 'Limit the number of received messages'),
6868
new InputOption('failure-limit', 'f', InputOption::VALUE_REQUIRED, 'The number of failed messages the worker can consume'),
6969
new InputOption('memory-limit', 'm', InputOption::VALUE_REQUIRED, 'The memory limit the worker can consume'),
70-
new InputOption('time-limit', 't', InputOption::VALUE_REQUIRED, 'The time limit in seconds the worker can run'),
70+
new InputOption('time-limit', 't', InputOption::VALUE_REQUIRED, 'The time limit in seconds the worker can handle new messages'),
7171
new InputOption('sleep', null, InputOption::VALUE_REQUIRED, 'Seconds to sleep before asking for new messages after no messages were found', 1),
7272
new InputOption('bus', 'b', InputOption::VALUE_REQUIRED, 'Name of the bus to which received messages should be dispatched (if not passed, bus is determined automatically)'),
7373
])
@@ -93,7 +93,7 @@ protected function configure(): void
9393
9494
<info>php %command.full_name% <receiver-name> --memory-limit=128M</info>
9595
96-
Use the --time-limit option to stop the worker when the given time limit (in seconds) is reached:
96+
Use the --time-limit option to stop the worker when the given time limit (in seconds) is reached (if a message is being handled, the worker will stop after the processing finished):
9797
9898
<info>php %command.full_name% <receiver-name> --time-limit=3600</info>
9999

0 commit comments

Comments
 (0)