Vastly speed up closed dep query.
This commit is contained in:
parent
44b95a2ea7
commit
59a04f7ab8
1 changed files with 6 additions and 14 deletions
|
@ -191,8 +191,9 @@ def run_query(bz):
|
||||||
querydata['v1'] = 'fedora-review[-+?]'
|
querydata['v1'] = 'fedora-review[-+?]'
|
||||||
|
|
||||||
dbprint("Running main query.")
|
dbprint("Running main query.")
|
||||||
|
t = time.time()
|
||||||
bugs = filter(lambda b: b.id not in trackers, bz.query(querydata))
|
bugs = filter(lambda b: b.id not in trackers, bz.query(querydata))
|
||||||
dbprint("Done.")
|
dbprint("Done, took {:.2f}.".format(time.time()-t))
|
||||||
|
|
||||||
for bug in bugs:
|
for bug in bugs:
|
||||||
bugdata[bug.id] = {}
|
bugdata[bug.id] = {}
|
||||||
|
@ -215,18 +216,10 @@ def run_query(bz):
|
||||||
bugdata[bug.id]['hidden'] = 1
|
bugdata[bug.id]['hidden'] = 1
|
||||||
|
|
||||||
# Get the status of each "interesting" bug
|
# Get the status of each "interesting" bug
|
||||||
dbprint("Have %d interesting bugs" % len(alldeps))
|
dbprint("Looking up {} bug deps.".format(len(alldeps)))
|
||||||
for i in seq_max_split(alldeps, 500):
|
for bug in filter(None, bz.query(bz.build_query(bug_id=list(alldeps), status=["CLOSED"]))):
|
||||||
dbprint("Looking up bug deps.")
|
closeddeps.add(bug.id)
|
||||||
#for bug in filter(None, bz._proxy.Bug.get_bugs({'ids':i, 'permissive': 1})['bugs']):
|
dbprint("Done; took {:.2f}.".format(time.time()-t))
|
||||||
for bug in filter(None, bz.getbugssimple(i)):
|
|
||||||
interesting[bug.id] = bug
|
|
||||||
dbprint("Done.")
|
|
||||||
|
|
||||||
# Note the dependencies which are closed
|
|
||||||
for i in alldeps:
|
|
||||||
if interesting[i].bug_status == 'CLOSED':
|
|
||||||
closeddeps.add(i)
|
|
||||||
|
|
||||||
# Hide tickets blocked by other bugs or those with various blockers and
|
# Hide tickets blocked by other bugs or those with various blockers and
|
||||||
# statuses.
|
# statuses.
|
||||||
|
@ -560,7 +553,6 @@ if __name__ == '__main__':
|
||||||
verbose = options.verbose
|
verbose = options.verbose
|
||||||
config = parse_config(options.configfile)
|
config = parse_config(options.configfile)
|
||||||
bz = bugzilla.RHBugzilla(url=config['url'], cookiefile=None, user=config['username'], password=config['password'])
|
bz = bugzilla.RHBugzilla(url=config['url'], cookiefile=None, user=config['username'], password=config['password'])
|
||||||
#bz = bugzilla.RHBugzilla(url=config['url'], cookiefile=None)
|
|
||||||
t = time.time()
|
t = time.time()
|
||||||
(bugs, bugdata, usermap) = run_query(bz)
|
(bugs, bugdata, usermap) = run_query(bz)
|
||||||
querytime = time.time() - t
|
querytime = time.time() - t
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue