Make IBKR heartbeat scheduler aware#145
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6df0840622
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
|
||
| now = dt.datetime.now(dt.timezone.utc) | ||
| since = now - dt.timedelta(hours=lookback_hours) | ||
| required_services = _load_required_services(project=project, since=since, now=now) |
There was a problem hiding this comment.
Handle empty due service sets as success
When scheduler-aware filtering determines that none of the configured services has a main scheduler due in the lookback window (for example a repo with only monthly schedulers on an ordinary weekday, or a skipped holiday window), this assignment leaves required_services as an empty list. The rest of main() then treats that the same as “no service filter configured” and still scans for any acceptable recent report, so it can emit a missing-report alert even though no scheduler was expected to produce one. Preserve the distinction between “no services configured” and “configured services, but none due” and short-circuit the latter as OK.
Useful? React with 👍 / 👎.
Summary
Root cause
The previous fix required a manually curated heartbeat service list. That works, but it drifts from Cloud Scheduler. The smarter behavior should require a report only for services whose main scheduler was expected to run inside the heartbeat lookback window.
Validation