2
0
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:
Ken Hibino
2022-04-01 11:57:00 -07:00
parent 18976c100f
commit d92642e942
6 changed files with 36 additions and 8 deletions

View File

@@ -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 {