Rephrase Evaluation channel log statement.

This commit is contained in:
Maximilian Paß
2023-11-23 13:07:29 +01:00
committed by Sebastian Serth
parent ab12c9046d
commit cb08787c7d

View File

@ -322,11 +322,15 @@ func handleEvaluationEvent(evaluations map[string]chan error, event *nomadApi.Ev
case structs.EvalStatusComplete, structs.EvalStatusCancelled, structs.EvalStatusFailed:
resultChannel, ok := evaluations[eval.ID]
if ok {
evalErr := checkEvaluation(eval)
select {
case resultChannel <- checkEvaluation(eval):
case resultChannel <- evalErr:
close(resultChannel)
case <-time.After(resultChannelWriteTimeout):
log.WithField("eval", eval).Error("Full evaluation channel")
log.WithField("length", len(resultChannel)).
WithField("eval", eval).
WithError(evalErr).
Error("Sending to the evaluation channel timed out")
}
}
}