Repository navigation
Replace carlescere/scheduler with an internal repeat package - #554
Merged
Merged
Conversation
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
Owner
Author
|
/e2e |
This comment has been minimized.
This comment has been minimized.
Code Metrics Report
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%)
Reported by octocov |
|
✅ E2E test passed successfully! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The polling loop only needs to call one function at a fixed interval. This replaces the
carlescere/schedulerdependency and its method-chain API with a small internal package,internal/repeat.repeat.Every(interval, job)callsjobright 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).Stopends the loop and waits for a call in progress to finish.beginShutdownnow calls it instead of sending to the scheduler'sQuitchannel; thestoppingflag andtickMuare kept as before.🤖 Generated with Claude Code
https://claude.ai/code/session_01Kxrqqw2Z6RFJ3utKsCSKD1