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

feat: Add ability to delay startup #619

Closed
PurseChicken opened this issue Nov 8, 2023 · 5 comments · Fixed by #631
Closed

feat: Add ability to delay startup #619

PurseChicken opened this issue Nov 8, 2023 · 5 comments · Fixed by #631
Assignees
Labels
feature New feature or request good first issue Good for newcomers

Comments

@PurseChicken
Copy link

PurseChicken commented Nov 8, 2023

Describe the feature request

I would like for there to be the ability to add a delay to the image starting up before executing /gatus.

I imagine this can be done internally based on an environment variable (e.g. GATUS_SLEEP). What might be easier is to modify the dockerfile to build from golang:alpine vs scratch. This will allow the use of sh or /bin/ash so that in Kubernetes, for example, we can overwrite the entrypoint be be something like /bin/ash -c sleep 5 /gatus.

Why do you personally want this feature to be implemented?

The reason why I am looking into this is because when using a sidecar in Kubernetes (for example cloud-sql-proxy), the gatus image comes up before the sidecar does and that causes an error since the database is not available yet. A simple way to solve this is to add a configurable delay to the gatus image to give the sidecar enough time to be ready for connections.

@PurseChicken PurseChicken changed the title Add ability to delay startup feat: Add ability to delay startup Nov 8, 2023
@TwiN
Copy link
Owner

TwiN commented Nov 12, 2023

We could just add a sleep function with a configurable duration (e.g. GATUS_DELAY_START_SECONDS) at the top of the main function.

@PurseChicken
Copy link
Author

We could just add a sleep function with a configurable duration (e.g. GATUS_DELAY_START_SECONDS) at the top of the main function.

Sounds amazing!

@TwiN TwiN added feature New feature or request good first issue Good for newcomers labels Nov 12, 2023
@vax-r
Copy link
Contributor

vax-r commented Nov 27, 2023

@TwiN @PurseChicken
Hello, if this issue isn't taken yet, I would like to try to solve it

@TwiN
Copy link
Owner

TwiN commented Nov 27, 2023

@vax-r Feel free to give it a shot!
I'll assign the issue to you for now - feel free to let me know if you change your mind!

@vax-r
Copy link
Contributor

vax-r commented Nov 28, 2023

Hello @TwiN , @PurseChicken
I've made some small adjustment to the code to enable this function
Please take a look if you have time, Thank you!

@TwiN TwiN closed this as completed in #631 Dec 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants