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:
Sybren A. Stüvel 2022-07-19 17:47:43 +02:00
parent ac3236786b
commit d929885b06

View File

@ -80,10 +80,12 @@ func (sm *StateMachine) taskStatusChangeOnly(
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
// rest of the function.
_ = sm.logStorage.WriteTimestamped(logger, job.UUID, task.UUID,
fmt.Sprintf("task changed status %s -> %s", oldTaskStatus, newTaskStatus))
}
// Broadcast this change to the SocketIO clients.
taskUpdate := webupdates.NewTaskUpdate(task)