mirror of
https://github.com/hibiken/asynqmon.git
synced 2025-01-19 03:05:53 +08:00
Fix list queues handler
This commit is contained in:
parent
50b7af8421
commit
60872a1ad7
@ -20,14 +20,14 @@ func newListQueuesHandlerFunc(inspector *inspeq.Inspector) http.HandlerFunc {
|
||||
http.Error(w, err.Error(), http.StatusInternalServerError)
|
||||
return
|
||||
}
|
||||
var snapshots []*QueueStateSnapshot
|
||||
for _, qname := range qnames {
|
||||
snapshots := make([]*QueueStateSnapshot, len(qnames))
|
||||
for i, qname := range qnames {
|
||||
s, err := inspector.CurrentStats(qname)
|
||||
if err != nil {
|
||||
http.Error(w, err.Error(), http.StatusInternalServerError)
|
||||
return
|
||||
}
|
||||
snapshots = append(snapshots, toQueueStateSnapshot(s))
|
||||
snapshots[i] = toQueueStateSnapshot(s)
|
||||
}
|
||||
payload := map[string]interface{}{"queues": snapshots}
|
||||
json.NewEncoder(w).Encode(payload)
|
||||
|
Loading…
Reference in New Issue
Block a user