mirror of
https://github.com/hibiken/asynqmon.git
synced 2025-09-22 06:46:34 +08:00
Add list groups REST endpoint
This commit is contained in:
@@ -433,6 +433,26 @@ func toCompletedTasks(in []*asynq.TaskInfo, pf PayloadFormatter, rf ResultFormat
|
||||
return out
|
||||
}
|
||||
|
||||
type groupInfo struct {
|
||||
Group string `json:"group"`
|
||||
Size int `json:"size"`
|
||||
}
|
||||
|
||||
func toGroupInfos(in []*asynq.GroupInfo) []*groupInfo {
|
||||
out := make([]*groupInfo, len(in))
|
||||
for i, g := range in {
|
||||
out[i] = toGroupInfo(g)
|
||||
}
|
||||
return out
|
||||
}
|
||||
|
||||
func toGroupInfo(in *asynq.GroupInfo) *groupInfo {
|
||||
return &groupInfo{
|
||||
Group: in.Group,
|
||||
Size: in.Size,
|
||||
}
|
||||
}
|
||||
|
||||
type schedulerEntry struct {
|
||||
ID string `json:"id"`
|
||||
Spec string `json:"spec"`
|
||||
|
Reference in New Issue
Block a user