From cb08787c7d20bbf6ffb710244a9da46b12dd5d91 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maximilian=20Pa=C3=9F?= <22845248+mpass99@users.noreply.github.com> Date: Thu, 23 Nov 2023 13:07:29 +0100 Subject: [PATCH] Rephrase Evaluation channel log statement. --- internal/nomad/nomad.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/internal/nomad/nomad.go b/internal/nomad/nomad.go index e7115ea..79f92ad 100644 --- a/internal/nomad/nomad.go +++ b/internal/nomad/nomad.go @@ -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") } } }