From 8230ef91789c81a0b09ea709806308f903dcb7b6 Mon Sep 17 00:00:00 2001 From: Torsten Werner Date: Sun, 4 Jul 2010 14:50:28 +0200 Subject: [PATCH] improve multithread robustness - create a separate db session per suite and component in writeSourceList() Signed-off-by: Torsten Werner --- dak/generate_filelist.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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') -- 2.39.5