From: Torsten Werner Date: Sun, 4 Jul 2010 12:50:28 +0000 (+0200) Subject: improve multithread robustness X-Git-Url: https://git.decadent.org.uk/gitweb/?a=commitdiff_plain;h=8230ef91789c81a0b09ea709806308f903dcb7b6;p=dak.git improve multithread robustness - create a separate db session per suite and component in writeSourceList() Signed-off-by: Torsten Werner --- diff --git a/dak/generate_filelist.py b/dak/generate_filelist.py index b7e0b507..a6686221 100755 --- a/dak/generate_filelist.py +++ b/dak/generate_filelist.py @@ -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')