Skip to content

Fix scheduler idle writes when monitors are paused#93

Merged
VrianCao merged 1 commit into
masterfrom
fix/issue-87-idle-scheduler-writes
Jun 23, 2026
Merged

Fix scheduler idle writes when monitors are paused#93
VrianCao merged 1 commit into
masterfrom
fix/issue-87-idle-scheduler-writes

Conversation

@VrianCao

Copy link
Copy Markdown
Owner

Summary

  • Add a schedulable-monitor preflight so paused/inactive monitors skip the monitor check pipeline.
  • Avoid scheduler lease/check-result/state/outage writes when no active non-paused monitors exist.
  • Keep idle maintenance notifications and public snapshot refresh work running so homepage/status/artifact snapshots do not expire.
  • Add regression coverage for all-paused idle ticks and post-lease pause races.

Root Cause

When all monitors were paused, the scheduler could still enter the no-due-monitor path and queue public snapshot/fragment work after acquiring the scheduler lease. That avoided monitor checks but still produced D1 writes unrelated to active monitoring.

Verification

  • pnpm --filter @uptimer/worker exec vitest run --config vitest.config.ts test/scheduled.test.ts
  • pnpm --filter @uptimer/worker typecheck
  • pnpm lint
  • pnpm typecheck
  • pnpm test
  • git diff --check

Fixes #87

@VrianCao VrianCao marked this pull request as ready for review June 23, 2026 15:09
@VrianCao VrianCao merged commit 1604eca into master Jun 23, 2026
4 checks passed
@VrianCao VrianCao deleted the fix/issue-87-idle-scheduler-writes branch June 23, 2026 15:09
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.

[Bug] D1写入行数异常

1 participant