Skip to content

Commit

Permalink
fix wrong filtering of dummy queue
Browse files Browse the repository at this point in the history
  • Loading branch information
IsThisEvenCode committed Jun 18, 2024
1 parent 420e586 commit bddf9ca
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pkg/modgearman/statusAdmin.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ func processGearmanQueues(address string, connectionMap map[string]net.Conn) ([]
continue
}

if len(parts) < 4 || (parts[0] == "dummy" && parts[1] == "") {
if len(parts) < 4 {

Check failure on line 47 in pkg/modgearman/statusAdmin.go

View workflow job for this annotation

GitHub Actions / test

Magic number: 4, in <condition> detected (mnd)
continue
}

Expand All @@ -61,6 +61,11 @@ func processGearmanQueues(address string, connectionMap map[string]net.Conn) ([]
return nil, "", fmt.Errorf("the received data is not in the right format -> %w", err)
}

// Skip dummy queue if empty
if parts[0] == "dummy" && totalInt == 0 {
continue
}

queueList = append(queueList, queue{
Name: parts[0],
Total: totalInt,
Expand Down

0 comments on commit bddf9ca

Please sign in to comment.