Repository navigation
fix: 运行时长排除暂停时间 - #60
Merged
Merged
Conversation
added 2 commits
October 27, 2026 13:37
Persist active_run_seconds + run_segment_started_at so task list and orchestration list_tasks accumulate only actual execution time across pause/resume/queue/terminal transitions.
Clear open run segments on process start without imputing downtime. Mirror terminal/pause runtime fields into memory before hydration, make SetPaused finalize segments, and add DB lifecycle tests.
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
修复任务列表「运行时长」在暂停后再运行时把暂停时间也算进去的问题:只累计实际 running 时间。
Root cause
前端
taskDuration与编排list_tasks使用「创建时间 → 现在/最后活动」墙钟,未扣除 pause / 排队等待。Fix
tasks.active_run_seconds、run_segment_started_atrun_seconds/active_run_seconds/run_segment_started_unixClearOpenTaskRunSegments:不把停机时间算进运行时长Test plan
go test ./server -run 'TaskRun|Runtime|Pause|Admission'go test ./db -run 'RunSegment|Runtime|Paused|Status|ClearOpen'(含生命周期)./build.shNotes
first_run_at/deadline_at语义未改(仍为墙钟)