mirror of
https://github.com/hibiken/asynqmon.git
synced 2026-08-04 22:55:24 +08:00
(ui): Fix inconsistent data shown in AggregatingTasks view
This commit is contained in:
@@ -9,7 +9,8 @@ import (
|
||||
)
|
||||
|
||||
type listGroupsResponse struct {
|
||||
Groups []*groupInfo `json:"groups"`
|
||||
Queue *queueStateSnapshot `json:"stats"`
|
||||
Groups []*groupInfo `json:"groups"`
|
||||
}
|
||||
|
||||
func newListGroupsHandlerFunc(inspector *asynq.Inspector) http.HandlerFunc {
|
||||
@@ -21,8 +22,14 @@ func newListGroupsHandlerFunc(inspector *asynq.Inspector) http.HandlerFunc {
|
||||
http.Error(w, err.Error(), http.StatusInternalServerError)
|
||||
return
|
||||
}
|
||||
qinfo, err := inspector.GetQueueInfo(qname)
|
||||
if err != nil {
|
||||
http.Error(w, err.Error(), http.StatusInternalServerError)
|
||||
return
|
||||
}
|
||||
|
||||
resp := listGroupsResponse{
|
||||
Queue: toQueueStateSnapshot(qinfo),
|
||||
Groups: toGroupInfos(groups),
|
||||
}
|
||||
if err := json.NewEncoder(w).Encode(resp); err != nil {
|
||||
|
||||
Reference in New Issue
Block a user