]> err.no Git - dak/commitdiff
improve multithread robustness
authorTorsten Werner <twerner@debian.org>
Sun, 4 Jul 2010 12:50:28 +0000 (14:50 +0200)
committerTorsten Werner <twerner@debian.org>
Sun, 4 Jul 2010 12:51:40 +0000 (14:51 +0200)
- create a separate db session per suite and component in writeSourceList()

Signed-off-by: Torsten Werner <twerner@debian.org>
dak/generate_filelist.py

index b7e0b5071511e0d3a650123f89843a73a80d4e6e..a668622183dbf72763de328614976d4074f1de21 100755 (executable)
@@ -117,10 +117,12 @@ def listPath(suite, component, architecture = None, type = None):
     pathname = os.path.join(Config()["Dir::Lists"], filename)
     return utils.open_file(pathname, "w")
 
-def writeSourceList(suite, component, session):
+def writeSourceList(suite, component):
     file = listPath(suite, component)
+    session = DBConn().session()
     for filename in getSources(suite, component, session):
         file.write(filename + '\n')
+    session.close()
     file.close()
 
 def writeBinaryList(suite, component, architecture, type):
@@ -181,7 +183,7 @@ def main():
                 try:
                     join.filter_by(arch_id = architecture.arch_id).one()
                     if architecture_name == 'source':
-                        writeSourceList(suite, component, session)
+                        writeSourceList(suite, component)
                     elif architecture_name != 'all':
                         writeBinaryList(suite, component, architecture, 'deb')
                         writeBinaryList(suite, component, architecture, 'udeb')