Skip to content

Commit 987be34

Browse files
committed
add comment
Signed-off-by: Mizhentaotuo Signed-off-by: mingzhe <[email protected]>
1 parent b92f46a commit 987be34

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

pkg/queue/queue_rpc.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ func GetCounts(
6666
resp, err := httpCl.Get(interceptorURL.String())
6767
if err != nil {
6868
m := &Counts{
69-
Counts: map[string]int{"all failed": -1},
69+
Counts: map[string]int{"all failed": 0},
7070
}
7171
return m, nil
7272
}

scaler/queue_pinger.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,8 @@ func fetchCounts(
254254
}
255255
}
256256

257+
// if fetch all failed, throw error
258+
// if any fetch succeeded, return counts from them
257259
if _, found := totalCounts["all failed"]; found && len(totalCounts) == 1 {
258260
return nil, 0, fmt.Errorf("fetching all counts failed, cannot reach any of the endpoints")
259261
}

0 commit comments

Comments
 (0)