Do not support sub-minute cron intervals#2172
Merged
antonpirker merged 3 commits intomasterfrom Jun 16, 2023
Merged
Conversation
antonpirker
commented
Jun 15, 2023
| interval = int(seconds / divider) | ||
| return (interval, unit) | ||
|
|
||
| return (1, "minute") |
Contributor
Author
There was a problem hiding this comment.
Before we just set everything that is under one minute to exactly one minute. Now We return the correct second interval.
antonpirker
commented
Jun 15, 2023
Comment on lines
+402
to
+406
| if schedule_unit == "second": | ||
| logger.warning( | ||
| "Intervals shorter than one minute are not supported by Sentry Crons." | ||
| ) | ||
| return {} |
Contributor
Author
There was a problem hiding this comment.
And when a second interval is returned, we print a warning and do not return a monitor config (this is the behavior the backend guys requested, because then they ignore the checkins)
antonpirker
commented
Jun 15, 2023
Comment on lines
+449
to
+450
| is_supported_schedule = bool(monitor_config) | ||
| if is_supported_schedule: |
Contributor
Author
There was a problem hiding this comment.
We now only create the "in_progress" checkin for supported schedule types (so if the schedule is sub-minute interval, the check in will not be sent)
Also because the headers are not set in case it is an unsupported type, the ok/failure checkins will also not be sent.
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.
In Celery you can run task in intervals shorter than one minute. Sentry crons does not support this, so in a case where a sub-minute interval is specified, just print a warning and do not set a schedule configuration.
Fixes #2168