Skip to content

Replace carlescere/scheduler with an internal repeat package - #554

Merged
linyows merged 1 commit into
mainfrom
replace-scheduler-with-repeat
Nov 24, 2026
Merged

linyows merged 1 commit into
mainfrom
replace-scheduler-with-repeat

Conversation

@linyows

@linyows linyows commented Nov 24, 2026

Copy link
Copy Markdown
Owner

The polling loop only needs to call one function at a fixed interval. This replaces the carlescere/scheduler dependency and its method-chain API with a small internal package, internal/repeat.

  • repeat.Every(interval, job) calls job right away and then at every interval, from a single goroutine, so calls never overlap. The call times are fixed from the start; when a call runs past one or more of them, those times are dropped and the next call happens at the first time still ahead, the same as the old scheduler skipping a tick while one is running.
  • (*Loop).Stop ends the loop and waits for a call in progress to finish. beginShutdown now calls it instead of sending to the scheduler's Quit channel; the stopping flag and tickMu are kept as before.
  • Comments, the log message on a start failure, and the sequence diagrams in the READMEs now say "polling loop" instead of "scheduler".

🤖 Generated with Claude Code

https://claude.ai/code/session_01Kxrqqw2Z6RFJ3utKsCSKD1

The polling loop only needs to call one function at a fixed interval, so
the method-chain scheduler is replaced by internal/repeat, which exposes
Every(interval, job) and Stop. Stop waits for a call in progress to
finish, so beginShutdown no longer relies on the scheduler's quit
channel.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kxrqqw2Z6RFJ3utKsCSKD1
@linyows

linyows commented Nov 24, 2026

Copy link
Copy Markdown
Owner Author

/e2e

@github-actions

This comment has been minimized.

@github-actions

Copy link
Copy Markdown

Code Metrics Report

main (5e37a77) #554 (5894fd7) +/-
Coverage 58.6% 58.8% +0.2%
Code to Test Ratio 1:1.3 1:1.3 +0.0
Test Execution Time 46s 1m48s +1m2s
Details
  |                     | main (5e37a77) | #554 (5894fd7) |  +/-  |
  |---------------------|----------------|----------------|-------|
+ | Coverage            |          58.6% |          58.8% | +0.2% |
  |   Files             |             70 |             71 |    +1 |
  |   Lines             |           5051 |           5077 |   +26 |
+ |   Covered           |           2964 |           2990 |   +26 |
+ | Code to Test Ratio  |          1:1.3 |          1:1.3 |  +0.0 |
  |   Code              |          11164 |          11222 |   +58 |
+ |   Test              |          14901 |          15054 |  +153 |
- | Test Execution Time |            46s |          1m48s | +1m2s |

Code coverage of files in pull request scope (48.6% → 51.7%, patch 92.3%)

Files Coverage +/- Patch Coverage Status
backoff.go 100.0% 0.0% - modified
dewy.go 35.9% 0.0% 25.0% modified
internal/repeat/repeat.go 100.0% +100.0% 100.0% added
lifecycle.go 47.5% 0.0% - modified

Reported by octocov

@github-actions

Copy link
Copy Markdown

✅ E2E test passed successfully!

@linyows
linyows merged commit fcadeea into main Nov 24, 2026
9 checks passed
@linyows
linyows deleted the replace-scheduler-with-repeat branch November 24, 2026 15:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant