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 --reverse flag to wait until the port is no longer available #102

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

gordalina
Copy link

This program is great at waiting for a service to become available, especially when we are coordinating programs that depend on network resources. Conversely, said programs sometimes need to wait for network resources to be closed or unavailable in order to shutdown gracefully.

This is where the --reverse flag comes in, it reverses the test that is being performed on the network resource. Allowing for the use case above to work.

This Pull Request also adds the accompanying test case.

@deiga
Copy link

deiga commented Jun 25, 2020

I think that this adds unnecessary complexity to the app.
Could you achieve the same functionality by using a while or until loop in your script?

@gordalina
Copy link
Author

The purpose of adding this to this program is to reduce complexity in the script that consumes it, which I believe to be the main reason to use wait-for-it: not to have to write the same error-prone code over and over for a given script/service.

@gordalina
Copy link
Author

@douglas-gibbons can you review this PR? Thank you.

@atkrad
Copy link

atkrad commented Jun 15, 2022

Hey @gordalina

You can use the Wait4X, It's already supported the reverse checking.

Example:
wait4x tcp 127.0.0.1:80 --invert-check

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants