Manager: only log task status change if there is an actual change
Don't log "changes" from, say, `active` -> `active`.
This commit is contained in:
parent
ac3236786b
commit
d929885b06
@ -80,10 +80,12 @@ func (sm *StateMachine) taskStatusChangeOnly(
|
|||||||
return fmt.Errorf("saving task to database: %w", err)
|
return fmt.Errorf("saving task to database: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if oldTaskStatus != newTaskStatus {
|
||||||
// logStorage already logs any error, and an error here shouldn't block the
|
// logStorage already logs any error, and an error here shouldn't block the
|
||||||
// rest of the function.
|
// rest of the function.
|
||||||
_ = sm.logStorage.WriteTimestamped(logger, job.UUID, task.UUID,
|
_ = sm.logStorage.WriteTimestamped(logger, job.UUID, task.UUID,
|
||||||
fmt.Sprintf("task changed status %s -> %s", oldTaskStatus, newTaskStatus))
|
fmt.Sprintf("task changed status %s -> %s", oldTaskStatus, newTaskStatus))
|
||||||
|
}
|
||||||
|
|
||||||
// Broadcast this change to the SocketIO clients.
|
// Broadcast this change to the SocketIO clients.
|
||||||
taskUpdate := webupdates.NewTaskUpdate(task)
|
taskUpdate := webupdates.NewTaskUpdate(task)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user