Repository navigation
feat(align): align 5h window refresh to cron targets - #3
Merged
Merged
Conversation
Add an `align` subcommand to manage cron targets (each with a Docker-style short id and its own max-delay budget) and preview upcoming ping/refresh times. `ping --if-5h-full` now does best-effort phase alignment by default, pinging only once the window is full and the aligned time is reached; `--without-align` restores the plain "ping when full" behavior. Targets and per-target max-delay (default 90m) persist to ~/.config/limitping/config.json. Push planned ping timestamps as a new metric for observability.
ShawnKung
added a commit
that referenced
this pull request
Sep 7, 2026
feat(align): align 5h window refresh to cron targets
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.
Summary
align子命令:管理多条 cron 目标,每条带 Docker 风格短 id 和自己的延时预算max-delay(默认 90m),支持add/list/delete <id|前缀>/clear/preview。ping --if-5h-full默认做“尽力而为”的相位对齐:满额且到达对齐时间后才 ping;--without-align关闭对齐,恢复“满额即 ping”。不带 flag 的ping仍是立即执行。~/.config/limitping/config.json;新增limitping_planned_ping_timestamp_seconds指标上报未来 5 次计划 ping 时间。Behavior matrix
pingping --if-5h-fullping --if-5h-full --without-alignTest plan
gofmt、go build ./...、go vet ./...、go test ./...全绿align add/list/delete/clear端到端验证,含每目标 max-delay 独立落盘与展示ping --help仅列出--dry-run/--if-5h-full/--without-align