Skip to content

Commit 8e06df9

Browse files
authored
Fix combined status (#440)
Don't fall through to an error status, when the collector status is "stopped".
1 parent 56bd153 commit 8e06df9

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

api/graylog.go

+5-7
Original file line numberDiff line numberDiff line change
@@ -276,14 +276,12 @@ func NewStatusRequest() graylog.StatusRequest {
276276
}
277277
}
278278

279-
switch {
280-
default:
281-
combinedStatus = backends.StatusRunning
282-
case stoppedCount != 0:
283-
combinedStatus = backends.StatusStopped
284-
fallthrough
285-
case errorCount != 0:
279+
if errorCount != 0 {
286280
combinedStatus = backends.StatusError
281+
} else if stoppedCount != 0 {
282+
combinedStatus = backends.StatusStopped
283+
} else {
284+
combinedStatus = backends.StatusRunning
287285
}
288286

289287
statusMessage := strconv.Itoa(runningCount) + " running / " +

0 commit comments

Comments
 (0)