fix(jobs): 留痕清理独立接通历史存储开关;精简死逻辑并对齐陈旧注释
This commit is contained in:
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user