]> err.no Git - dak/commitdiff
Delay setting up worker pool.
authorAnsgar Burchardt <ansgar@debian.org>
Mon, 5 Sep 2011 19:28:25 +0000 (19:28 +0000)
committerAnsgar Burchardt <ansgar@debian.org>
Mon, 5 Sep 2011 19:28:25 +0000 (19:28 +0000)
We need to delay creating the worker pool until we have parsed the
command line options so that changes also take effect in child
processes.

dak/generate_packages_sources2.py

index 5716e7e186df2b234d533df591daedcec77629f6..4b2a1d182c040f85143c8da9fae34da41869fdee 100755 (executable)
@@ -293,10 +293,6 @@ def generate_translations(suite_id, component_id):
 #############################################################################
 
 def main():
-    from daklib.dakmultiprocessing import DakProcessPool, PROC_STATUS_SUCCESS, PROC_STATUS_SIGNALRAISED
-    pool = DakProcessPool()
-
-    from daklib.dbconn import Component, DBConn, get_suite, Suite
     from daklib.config import Config
     from daklib import daklog
 
@@ -317,8 +313,12 @@ def main():
     if Options.has_key("Help"):
         usage()
 
+    from daklib.dakmultiprocessing import DakProcessPool, PROC_STATUS_SUCCESS, PROC_STATUS_SIGNALRAISED
+    pool = DakProcessPool()
+
     logger = daklog.Logger('generate-packages-sources2')
 
+    from daklib.dbconn import Component, DBConn, get_suite, Suite
     session = DBConn().session()
     session.execute("SELECT add_missing_description_md5()")
     session.commit()