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

@@ -855,7 +855,7 @@ func (r *RDB) ListSchedulerEntries() ([]*base.SchedulerEntry, error) {
// ListSchedulerEnqueueEvents returns the list of scheduler enqueue events.
func (r *RDB) ListSchedulerEnqueueEvents(entryID string, pgn Pagination) ([]*base.SchedulerEnqueueEvent, error) {
key := base.SchedulerHistoryKey(entryID)
zs, err := r.client.ZRangeWithScores(key, pgn.start(), pgn.stop()).Result()
zs, err := r.client.ZRevRangeWithScores(key, pgn.start(), pgn.stop()).Result()
if err != nil {
return nil, err
}