X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=dak%2Fshow_new.py;h=2ec2c3518bae47d43c3104eba8f54561be416d7e;hb=6aa926a257c755fc75b394d9d0a7273faf994a2d;hp=efc4ee8c40ff43247968618abcbca3bff4bf0569;hpb=73e23995d806657f985ab44272905512a2368b55;p=dak.git diff --git a/dak/show_new.py b/dak/show_new.py index efc4ee8c..2ec2c351 100755 --- a/dak/show_new.py +++ b/dak/show_new.py @@ -153,6 +153,8 @@ def html_footer(): def do_pkg(upload_id): + cnf = Config() + session = DBConn().session() upload = session.query(PolicyQueueUpload).filter_by(id=upload_id).one() @@ -178,8 +180,10 @@ def do_pkg(upload_id): htmlfiles_to_process.append(htmlfile) sources.append(htmlname) + group = cnf.get('Dinstall::UnprivGroup') or None + with open(htmlfile, 'w') as outfile: - with policy.UploadCopy(upload) as upload_copy: + with policy.UploadCopy(upload, group=group) as upload_copy: handler = policy.PolicyQueueUploadHandler(upload, session) missing = [ (o['type'], o['package']) for o in handler.missing_overrides() ] distribution = changes.distribution @@ -245,17 +249,19 @@ def init(session): ################################################################################ def main(): + examine_package.use_html = True + pool = DakProcessPool(processes=5) + session = DBConn().session() upload_ids = [ u.id for u in init(session) ] session.close() - examine_package.use_html=1 - - pool = DakProcessPool(processes=5) - p = pool.map_async(do_pkg, upload_ids) + for upload_id in upload_ids: + pool.apply_async(do_pkg, [upload_id]) pool.close() - p.wait(timeout=600) + #p.wait(timeout=600) + pool.join() for htmlfile in htmlfiles_to_process: with open(htmlfile, "w") as fd: fd.write(timeout_str)