Skip to content
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

Add --no-wait argument #593

Merged
merged 1 commit into from
Oct 6, 2023
Merged

Add --no-wait argument #593

merged 1 commit into from
Oct 6, 2023

Conversation

MikeMcQuaid
Copy link
Member

@MikeMcQuaid MikeMcQuaid commented Oct 5, 2023

This prevents us from looping and waiting for brew services stop to finish stopping the service if we just want to attempt once and immediately exit.

While we're here, also fix verbose output for brew services restart.

@MikeMcQuaid MikeMcQuaid requested a review from SMillerDev October 5, 2023 16:09
@SMillerDev
Copy link
Member

This seems to be a good option to add to systemd in this case.


     --no-block
           Do not synchronously wait for the requested operation to
           finish. If this is not specified, the job will be verified,
           enqueued and systemctl will wait until the unit's start-up is
           completed. By passing this argument, it is only verified and
           enqueued. This option may not be combined with --wait.

This prevents us from looping and waiting for `brew services stop` to
finish stopping the service if we just want to attempt once and
immediately exit.

While we're here, also fix verbose output for `brew services restart`.
@MikeMcQuaid
Copy link
Member Author

@SMillerDev Good catch, added.

@MikeMcQuaid MikeMcQuaid merged commit f9d59c8 into Homebrew:master Oct 6, 2023
@MikeMcQuaid MikeMcQuaid deleted the no_wait branch October 6, 2023 11:32
Comment on lines +145 to +147
systemctl_args = System.systemctl_args
if no_wait
systemctl_args << "--no-block"
Copy link
Contributor

Choose a reason for hiding this comment

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

It doesn't look like the systemctl_args variable is actually used anywhere in this method outside of lines 145 and 147. I assume it's supposed to be used on line 154 as well.

Copy link
Member Author

Choose a reason for hiding this comment

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

@apainintheneck Whoops, opened PR in #596

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 10, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants