Skip to content

Make LongBridge heartbeat scheduler-aware#146

Merged
Pigbibi merged 1 commit into
mainfrom
fix/scheduler-aware-heartbeat
Jun 10, 2026
Merged

Make LongBridge heartbeat scheduler-aware#146
Pigbibi merged 1 commit into
mainfrom
fix/scheduler-aware-heartbeat

Conversation

@Pigbibi

@Pigbibi Pigbibi commented Jun 10, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • derive heartbeat service checks from Cloud Scheduler main jobs when scheduler-aware mode is enabled
  • skip heartbeat cleanly when no configured main scheduler job is due in the lookback window
  • sync Cloud Scheduler job timezones from the current LongBridge market config during env sync

Tests

  • PYTHONPATH=. python -m pytest -q tests/test_execution_report_heartbeat.py
  • bash tests/test_sync_cloud_run_env_workflow.sh
  • python -m ruff check scripts/execution_report_heartbeat.py tests/test_execution_report_heartbeat.py
  • python -m py_compile scripts/execution_report_heartbeat.py tests/test_execution_report_heartbeat.py

@Pigbibi Pigbibi merged commit 962cbc5 into main Jun 10, 2026
1 check passed
@Pigbibi Pigbibi deleted the fix/scheduler-aware-heartbeat branch June 10, 2026 05:05

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6c09861d5f

ℹ️ 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".

minute_values = _cron_field_values(minute, minimum=0, maximum=59)
hour_values = _cron_field_values(hour, minimum=0, maximum=23)
dom_values = _cron_field_values(day_of_month, minimum=1, maximum=31)
month_values = _cron_field_values(month, minimum=1, maximum=12)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Handle Cloud Scheduler month names

Cloud Scheduler accepts month names (JAN through DEC) in the month field per the Google Cloud cron-format docs, but this parser only supplies a names table for day-of-week. When a valid scheduler job for one of these services uses a schedule such as 45 15 * JAN *, _cron_token_value() tries int('jan'), raising ValueError; that exception is not caught by _resolve_required_services, so the heartbeat workflow exits instead of checking or safely skipping the service.

Useful? React with 👍 / 👎.

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