PR#1909: a follow-up fix for koji-gc
Merges #1909 https://pagure.io/koji/pull-request/1909 Fixes: #1697 https://pagure.io/koji/issue/1697 koji-gc: untagging/moving to trashcan is very slow
This commit is contained in:
commit
20de2b89cb
1 changed files with 2 additions and 1 deletions
|
|
@ -444,6 +444,7 @@ def handle_trash():
|
||||||
for binfo in untagged:
|
for binfo in untagged:
|
||||||
i += 1
|
i += 1
|
||||||
nvr = "%(name)s-%(version)s-%(release)s" % binfo
|
nvr = "%(name)s-%(version)s-%(release)s" % binfo
|
||||||
|
binfo['nvr'] = nvr
|
||||||
if not check_package(binfo['name']):
|
if not check_package(binfo['name']):
|
||||||
if options.debug:
|
if options.debug:
|
||||||
print("[%i/%i] Skipping package: %s" % (i, N, nvr))
|
print("[%i/%i] Skipping package: %s" % (i, N, nvr))
|
||||||
|
|
@ -457,6 +458,7 @@ def handle_trash():
|
||||||
mcall.buildReferences(binfo['id'], limit=10, lazy=True)
|
mcall.buildReferences(binfo['id'], limit=10, lazy=True)
|
||||||
for binfo, [refs] in six.moves.zip(continuing, mcall.call_all()):
|
for binfo, [refs] in six.moves.zip(continuing, mcall.call_all()):
|
||||||
i += 1
|
i += 1
|
||||||
|
nvr = binfo['nvr']
|
||||||
#XXX - this is more data than we need
|
#XXX - this is more data than we need
|
||||||
# also, this call takes waaaay longer than it should
|
# also, this call takes waaaay longer than it should
|
||||||
if refs.get('tags'):
|
if refs.get('tags'):
|
||||||
|
|
@ -530,7 +532,6 @@ def handle_trash():
|
||||||
#ok, go ahead add it to the list
|
#ok, go ahead add it to the list
|
||||||
if binfo2 is None:
|
if binfo2 is None:
|
||||||
binfo2 = session.getBuild(binfo['id'])
|
binfo2 = session.getBuild(binfo['id'])
|
||||||
binfo2['nvr'] = nvr
|
|
||||||
print("[%i/%i] Adding build to trash list: %s" % (i, N, nvr))
|
print("[%i/%i] Adding build to trash list: %s" % (i, N, nvr))
|
||||||
to_trash.append(binfo2)
|
to_trash.append(binfo2)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue