2
0
mirror of https://github.com/hibiken/asynq.git synced 2025-08-19 15:08:55 +08:00

Fix ListSchedulerEnqueueEvents to list recent events first

This commit is contained in:
Ken Hibino
2020-12-26 14:35:25 -08:00
parent 38509e309f
commit 196d66f221
3 changed files with 22 additions and 23 deletions

View File

@@ -118,12 +118,6 @@ func cronHistory(cmd *cobra.Command, args []string) {
continue
}
// Sort entries by enqueuedAt timestamp.
sort.Slice(events, func(i, j int) bool {
x, y := events[i], events[j]
return x.EnqueuedAt.Unix() > y.EnqueuedAt.Unix()
})
cols := []string{"TaskID", "EnqueuedAt"}
printRows := func(w io.Writer, tmpl string) {
for _, e := range events {