Repository navigation
fix(run): 试跑不再写入 periodSuccess/lastSuccessAt,避免吞掉当天调度的投递名额 - #196
Merged
Merged
Conversation
Runner.record() 之前无条件把「成功」写进当天去重标记,未区分 dryRun。 schedule.succeededToday() 正是读 periodSuccess / lastSuccessAt 判「该周期今天 已成功」,于是「试跑(不提交)」一次后,当天该周期的定时投递会被静默跳过: 不进历史、无日志、nextRunAt 仍显示次日。 改为只让真正走完投递路径的运行占用名额(delivered = ok && !dryRun); lastRunAt 仍无条件写,它表示「最近一次尝试」,不是去重键。 影响:面板「试跑」与 trending_run 的 dryRun 都会踩中,默认 period=daily。 补一条回归:dry-run 后 periodSuccess/lastSuccessAt 均为空,正常 run 两者写入。 Closes #195
Merged
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.
背景 / Why
Closes #195。
在面板点一次「试跑(不提交)」之后,当天该周期的定时运行不会再发生——不提交、不开 PR,而且静默:历史里没有记录,
nextRunAt照常显示次日,看起来一切正常。根因:
Runner.record()无条件把「成功」写进当天去重标记,未区分dryRun。而schedule.succeededToday()正是读periodSuccess/lastSuccessAt判「该周期今天已成功」,于是试跑一次就把当天该周期的投递名额吞掉。改动 / What
src/host/runner.ts:只让真正走完投递路径的运行占用当天名额(delivered = ok && !dryRun);lastRunAt保持无条件写(它表示「最近一次尝试」,不是去重键)。src/state.ts:lastSuccessAt/periodSuccess注释注明「不含 dry-run」。test/runner.test.mjs:新增回归——dry-run 后两者均为空,正常 run 两者写入。说明
trending_run的dryRun都会踩中;默认period=daily时最常见是日榜当天被吞。验证
npm run check全绿:380 单测通过(含新增 1),AC-P 12/12。