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

Added parameter 'loopHealthCheck' in function 'watchDependencies' #37

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

Conversation

carlosrodj
Copy link

The problem:
k8s applications that use livenessprobe perform health checks every 15 seconds. The 15s loop on watchDependencies becomes redundant

Proposed solution:

Adding the loopHealthCheck parameter with a default value of true that when fed with false disables the loop, just registering the method.

C1311302 Carlos Goncalves Rodrigues Junior added 2 commits January 14, 2021 15:05
@KarineValenca
Copy link
Collaborator

@carlosrodj thank you for the PR! It makes a lot of sense. Would you mind adding some test cases to cover the new behavior you implemented?

…tration of the healthcheck without the loop
@carlosrodj
Copy link
Author

Your suggestion made me rethink the solution, taking into account that the function's return is treated as a callback, we would have to change the order of the parameters, thus generating a possible break in applications that already use lib.

Thus, I decided to create a new method that performs the registration of the health check without the looping of the setInterval.

What do you think ?

@KarineValenca
Copy link
Collaborator

@carlosrodj I'm analyzing this solution with a coleague, then I'll give you a feedback. Meanwhile, I think you should change your username and email in the commits, they contain sensitive information.

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.

2 participants