Skip to content

[Messenger] Messenger: add --duration option to messenger:stop-workers command #60517

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: 7.3
Choose a base branch
from

Conversation

dwalck
Copy link

@dwalck dwalck commented May 22, 2025

Q A
Branch? 7.4
Bug fix? no
New feature? yes
Deprecations? no
License MIT

Hi!

My proposal is to add a --duration option to the messenger:stop-workers command, which would allow to "pause" the workers for the amount of time specified in this option.

For example, if we pass --duration=10, then for the next 10 seconds, running messenger:consume will return a message indicating how many seconds are left until the "pause" ends.

I think this option would be helpful during deployments (we're using it this way in my company).

image

image

@carsonbot
Copy link

Hey!

I see that this is your first PR. That is great! Welcome!

Symfony has a contribution guide which I suggest you to read.

In short:

  • Always add tests
  • Keep backward compatibility (see https://symfony.com/bc).
  • Bug fixes must be submitted against the lowest maintained branch where they apply (see https://symfony.com/releases)
  • Features and deprecations must be submitted against the 7.3 branch.

Review the GitHub status checks of your pull request and try to solve the reported issues. If some tests are failing, try to see if they are failing because of this change.

When two Symfony core team members approve this change, it will be merged and you will become an official Symfony contributor!
If this PR is merged in a lower version branch, it will be merged up to all maintained branches within a few days.

I am going to sit back now and wait for the reviews.

Cheers!

Carsonbot

@carsonbot carsonbot changed the title Messenger: add --duration option to messenger:stop-workers command [Messenger] Messenger: add --duration option to messenger:stop-workers command May 23, 2025
@OskarStark
Copy link
Contributor

Please add a line in the changelog. Please use 7.4 there, as 7.3 is already in feature freeze 🥶

It looks that your committer email is not associated with your GitHub account, you might want to check this.

@dwalck dwalck force-pushed the feature/messenger-stop-workers-duration branch from 5be2d14 to 3c603a7 Compare May 23, 2025 06:17
@dwalck dwalck force-pushed the feature/messenger-stop-workers-duration branch from 3c603a7 to 779fcb2 Compare May 23, 2025 06:19
7.4
---

* Add `--duration` option to `messenger:stop-workers` command to keep workers in paused state.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* Add `--duration` option to `messenger:stop-workers` command to keep workers in paused state.
* Add `--duration` option to `messenger:stop-workers` command to keep workers in paused state

@OskarStark OskarStark changed the title [Messenger] Messenger: add --duration option to messenger:stop-workers command [Messenger] Messenger: add --duration option to messenger:stop-workers command May 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants