fix error comparison
This commit is contained in:
parent
971aa40615
commit
d2212e2478
1 changed files with 4 additions and 2 deletions
|
@ -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)
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue