Skip to content

fix(celery): Don't round down beat schedule intervals - #7842

Draft
wedamija wants to merge 2 commits into
masterfrom
danf/celery-beat-interval
Draft

wedamija wants to merge 2 commits into
masterfrom
danf/celery-beat-interval

Conversation

@wedamija

@wedamija wedamija commented Oct 2, 2026 •

Copy link
Copy Markdown
Member

Description

Fixes Celery beat interval schedules being rounded down. A 90-minute schedule was sent as "1 hour" and a 36-hour one as "1 day", so Sentry expected runs that never happened and raised false missed-check-in alerts.

Intervals now use the largest unit that divides them evenly (90 minutes stays 90 minutes). Intervals that aren't a whole number of minutes, such as 90 seconds, send no monitor config and log a warning, like sub-minute intervals already do.

Existing monitors with uneven intervals get the correct interval on their next check-in. For intervals that now send no config, new monitors aren't auto-created and existing ones keep their current schedule.

Testing

Unit tests for the interval conversion and the beat monitor config.

Interval schedules were truncated to the largest unit they exceed, so
a 90-minute schedule was reported as 1 hour and a 36-hour one as 1 day.
Use the largest unit that divides the interval evenly instead, and send
no monitor config (with a warning) if it isn't a whole number of minutes.

Co-Authored-By: Claude <noreply@anthropic.com>
@github-actions

github-actions Bot commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

Codecov Results 📊

✅ 133361 passed | ⏭️ 7222 skipped | Total: 140583 | Pass Rate: 94.86% | Execution Time: 441m 8s

📊 Comparison with Base Branch

Metric Change
Total Tests 📈 +198
Passed Tests 📈 +199
Failed Tests 📉 -1
Skipped Tests —

➖ Removed Tests (1)

View removed tests
  • test_cache_spans_decorator[True]
    • File: tests.integrations.django.test_cache_module

All tests are passing successfully.

✅ Patch coverage is 100.00%. Project has 2562 uncovered lines.
❌ Project coverage is 90.35%. Comparing base (8afefe8) to head (fe764c5).

Coverage diff
@@            Coverage Diff             @@
##        master       #PR       +/-##
==========================================
- Coverage    90.37%    90.35%    -0.02%
==========================================
  Files          202       203        +1
  Lines        26552     26556        +4
  Branches      9858      9860        +2
==========================================
+ Hits         23997     23994        -3
- Misses        2555      2562        +7
- Partials      1487      1487         —

Generated by Codecov Action

Matches the sub-minute warning.

Co-Authored-By: Claude <noreply@anthropic.com>

This branch has not been deployed

No deployments
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.

1 participant