]> git.decadent.org.uk Git - dak.git/blobdiff - dak/show_new.py
dak/show_new.py: setup worker pool before connecting to database
[dak.git] / dak / show_new.py
index b3420194de9c073002f06d836f4392461e97ee96..f45ffe9d622616b8767f5d683e40e5bb5e4842df 100755 (executable)
@@ -166,7 +166,7 @@ def do_pkg(upload_id):
     htmlfile = os.path.join(cnf['Show-New::HTMLPath'], htmlname)
 
     # Have we already processed this?
-    if False and os.path.exists(htmlfile) and \
+    if os.path.exists(htmlfile) and \
         os.stat(htmlfile).st_mtime > time.mktime(changes.created.timetuple()):
             with open(htmlfile, "r") as fd:
                 if fd.read() != timeout_str:
@@ -245,13 +245,14 @@ def init(session):
 ################################################################################
 
 def main():
+    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)
     pool.close()