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 starting delay when proc start #137

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

Conversation

seiferli
Copy link

sleep N sec AT startProcs() . because sometimes, dependencies checking between stateful services (procs) will let it starting fail .

@mattn
Copy link
Owner

mattn commented Mar 16, 2023

Thank you. Could you please explain this use-case?


.idea
.git
.cover
Copy link
Owner

Choose a reason for hiding this comment

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

Is this change requied?

@seiferli
Copy link
Author

For example:

I have three services in the Procfile, A, B, and C
Service B must detect that Service A is successful, and the listen port must be started when B starting,
If there is no enought runing interval, the startup of Service B will fail, this is my real use-case. :)

The same situation also occurs when procStop(). In stateful services, the order of startup and shutdown is often the opposite.

@mattn
Copy link
Owner

mattn commented Mar 17, 2023

Do not modify color table.

@joeblew99
Copy link

joeblew99 commented Aug 22, 2023

hey

i think delay is a good idea and should go in.

The other way to do this is to us the "wait-for" pattern that waits on a tcp ip based process.
Its basically doing what docker does with "depends on" syntax in docker.

https://github.com/roerohan/wait-for-it

  • waits on tcp / http
  • has delay feature also.
dep:
     # https://github.com/roerohan/wait-for-it
     go install github.com/roerohan/wait-for-it@latest
test-0:
     wait-for-it google.com:80 -- echo "It works\!"
test-1:
     wait-for-it -w google.com:80 -w localhost:27017 -t 30 -- echo "Waiting for 30 seconds for google.com:80 and localhost:27017"

https://github.com/atkrad/wait4x is another one

  • has delay
  • has backoff / time out / rety.

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