goreman
goreman copied to clipboard
add starting delay when proc start
sleep N sec AT startProcs() . because sometimes, dependencies checking between stateful services (procs) will let it starting fail .
Thank you. Could you please explain this use-case?
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.
Do not modify color table.
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.