Skip to content

Commit

Permalink
fix: check for warning error correctly
Browse files Browse the repository at this point in the history
Signed-off-by: Matt Gleich <[email protected]>
  • Loading branch information
gleich committed Dec 3, 2024
1 parent 4b398a9 commit 3a81276
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion internal/cache/cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package cache

import (
"encoding/json"
"errors"
"fmt"
"net/http"
"path/filepath"
Expand Down Expand Up @@ -103,7 +104,7 @@ func (c *Cache[T]) StartPeriodicUpdate(updateFunc func() (T, error), interval ti
defer ticker.Stop()
for range ticker.C {
data, err := updateFunc()
if err != nil && err.Error() != apis.WarningError.Error() {
if err != nil && !errors.Is(err, apis.WarningError) {
lumber.Error(err, "updating", c.name, "cache failed")
continue
}
Expand Down

0 comments on commit 3a81276

Please sign in to comment.