koji-gc: fix history order

Fixes: https://pagure.io/koji/issue/2270
This commit is contained in:
Tomas Kopecek 2020-06-02 14:19:08 +02:00
parent 604f25032e
commit 9f54386279

View file

@ -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)