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

Function quiet? every return true #130

Open
ArmandoAssuncao opened this issue Nov 6, 2024 · 0 comments
Open

Function quiet? every return true #130

ArmandoAssuncao opened this issue Nov 6, 2024 · 0 comments

Comments

@ArmandoAssuncao
Copy link

ArmandoAssuncao commented Nov 6, 2024

@quiet - Time.now will always be smaller than quiet_timeout, so, if the sidekiq process is in quiet mode manually or the process does not die, the health check will continue return 200.

def quiet?
@quiet && (@quiet - Time.now) < SidekiqAlive.config.quiet_timeout
end

validation should be like this:

@quiet && (Time.now - @quiet) < SidekiqAlive.config.quiet_timeout

With that, you will have 3 scenarios:

  1. if time is smaller than quiet_timeout, returns code 200 with message Server is shutting down
  2. if time is greater than quiet_timeout and alive? is true, returns code 200 with message Alive!
  3. if time is greater than quiet_timeout and alive? is false, returns code 404 with message Can't find the alive key

To test, use the quiet button of sidekiq web.

what do you think?

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

No branches or pull requests

1 participant