fix(jobs): 留痕清理独立接通历史存储开关;精简死逻辑并对齐陈旧注释

This commit is contained in:
windyboy
2026-09-11 14:26:44 +08:00
parent d909a88167
commit a84751bf03
14 changed files with 75 additions and 72 deletions
@@ -20,8 +20,7 @@ class ProcFailure(
private val procState: ProcStateRepository,
val scheduler: FailureScheduler,
) {
/** @return 是否已经落到终态:DEAD 是终态,FAILED 还会再试 */
fun fail(head: ProcState, ec: ErrorClass, reason: String): Boolean {
fun fail(head: ProcState, ec: ErrorClass, reason: String) {
val attempts = head.attempts + 1
if (scheduler.exhausted(attempts)) {
procState.markTerminal(
@@ -31,7 +30,6 @@ class ProcFailure(
lastError = "$reason; attempts=$attempts",
now = scheduler.now(),
)
return true
}
procState.update(
head.msgId, ProcStatus.FAILED,
@@ -40,6 +38,5 @@ class ProcFailure(
errorClass = ec,
lastError = reason,
)
return false
}
}