[omdb] fix wrong cooldown in omdb db instance show#10672
Open
hawkw wants to merge 2 commits into
Open
Conversation
Member
Author
|
Huh...did I do that? I don't think I did... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
omdb db instance showcommand currently displays the auto-restart cooldown duration as a time delta, calculated by theInstanceAutoRestart::can_reincarnatefunction. This function returns aTimeDeltawith a comment suggesting that this is an absolute expiry timestamp, but it is actually the duration until that timestamp, calculated by subtracting the currentUtc::nowfrom the expiry time. This means that ifUtc::now()in the omdb process ever returns a timestamp wherenow.signed_duration_since(last)is negative, the calculated cooldown duration will appear to be many years long. This branch fixes that by just makingcan_reincarnatereturn the absolute timestamp at which the cooldown will expire, which is what the doc comment on the enum says it is anyway. Since the timestamp value is only used byomdbanyway, this is a low-risk change.I also added some additional help text to explain what these values mean.
Fixes #10660