From 272a718483edfe901406ccf5a26afaf5e44b0014 Mon Sep 17 00:00:00 2001 From: Tomas Kopecek Date: Jun 03 2020 10:54:14 +0000 Subject: PR#2279: koji-gc: fix query order Merges #2279 https://pagure.io/koji/pull-request/2279 Fixes: #2270 https://pagure.io/koji/issue/2270 koji-gc could use wrong order for pruning decisions --- diff --git a/util/koji-gc b/util/koji-gc index 35f3fbb..0888854 100755 --- a/util/koji-gc +++ b/util/koji-gc @@ -871,6 +871,7 @@ def handle_prune(): print("Pruning tag: %s" % tagname) # get builds history = session.queryHistory(tag=tagname, active=True)['tag_listing'] + history = sorted(history, key=lambda x: -x['create_ts']) if not history: if options.debug: print("No history for %s" % tagname)