]> git.decadent.org.uk Git - dak.git/blobdiff - dak/show_new.py
show-new: limit to five threads to avoid using too many resources
[dak.git] / dak / show_new.py
index 194559c2076f70ccead7159aa7c37c3cb8971e49..d2b133b74fab208397eaa5d962d18066dae3a33a 100755 (executable)
@@ -276,15 +276,13 @@ def main():
 
     examine_package.use_html=1
 
-    pool = DakProcessPool()
+    pool = DakProcessPool(processes=5)
     p = pool.map_async(do_pkg, changes_files)
     pool.close()
-    try:
-        p.get(timeout=600)
-    except TimeoutError:
-        for htmlfile in htmlfiles_to_process:
-            with open(htmlfile, "w") as fd:
-                fd.write("Timed out while processing")
+    p.wait(timeout=600)
+    for htmlfile in htmlfiles_to_process:
+        with open(htmlfile, "w") as fd:
+            fd.write("Timed out while processing")
 
     files = set(os.listdir(cnf["Show-New::HTMLPath"]))
     to_delete = filter(lambda x: x.endswith(".html"), files.difference(set(sources)))