Skip to content

Commit

Permalink
llbsolver: fix sorting of history records
Browse files Browse the repository at this point in the history
Signed-off-by: Tonis Tiigi <[email protected]>
(cherry picked from commit f6d1845)
  • Loading branch information
tonistiigi committed Mar 22, 2023
1 parent 90ff220 commit 103bf22
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions solver/llbsolver/history.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,13 +102,13 @@ func (h *HistoryQueue) gc() error {
}

// in order for record to get deleted by gc it exceed both maxentries and maxage criteria

if len(records) < int(h.CleanConfig.MaxEntries) {
return nil
}

// sort array by newest records first
sort.Slice(records, func(i, j int) bool {
return records[i].CompletedAt.Before(*records[j].CompletedAt)
return records[i].CompletedAt.After(*records[j].CompletedAt)
})

h.mu.Lock()
Expand Down

0 comments on commit 103bf22

Please sign in to comment.