diff --git a/server/worker.go b/server/worker.go index 8fb13ad..eee3e3f 100644 --- a/server/worker.go +++ b/server/worker.go @@ -2,9 +2,9 @@ package server import ( "context" - "errors" "log/slog" "net/http" + "strings" "sync" "time" @@ -200,7 +200,9 @@ func updateWorkerTaskStatus(ctx context.Context) { defer wg.Done() var ts types.TaskStatus _, err := rpcServer.Call(ctx, w.Conn, "task-status", tsr, &ts) - if errors.Is(err, constants.ErrTaskDoesNotExist) { + + // Find better way to compare errors which where send via websocket + if strings.HasSuffix(err.Error(), constants.ErrTaskDoesNotExist.Error()) { // Worker says it does not know of this task, mark it failed so that we don't asks the worker about it again and again slog.ErrorContext(ctx, "Task is unkown by worker, Failing...", "err", err)