From: Torsten Werner Date: Thu, 15 Jul 2010 21:47:44 +0000 (+0000) Subject: generate-filelist: create fewer DB sessions X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=af1ca499f256da9e685a3f0e112e12033b852ed5;p=dak generate-filelist: create fewer DB sessions Signed-off-by: Torsten Werner --- diff --git a/dak/generate_filelist.py b/dak/generate_filelist.py index f9e9dad6..a2246f5c 100755 --- a/dak/generate_filelist.py +++ b/dak/generate_filelist.py @@ -191,14 +191,15 @@ def main(): ('c', "component", "Filelist::Options::Component", "HasArg"), ('a', "architecture", "Filelist::Options::Architecture", "HasArg"), ('i', "incremental", "Filelist::Options::Incremental")] - query_suites = DBConn().session().query(Suite) + session = DBConn().session() + query_suites = session.query(Suite) suites = [suite.suite_name for suite in query_suites.all()] if not cnf.has_key('Filelist::Options::Suite'): cnf['Filelist::Options::Suite'] = ','.join(suites) # we can ask the database for components if 'mixed' is gone if not cnf.has_key('Filelist::Options::Component'): cnf['Filelist::Options::Component'] = 'main,contrib,non-free' - query_architectures = DBConn().session().query(Architecture) + query_architectures = session.query(Architecture) architectures = \ [architecture.arch_string for architecture in query_architectures.all()] if not cnf.has_key('Filelist::Options::Architecture'): @@ -209,7 +210,6 @@ def main(): Options = cnf.SubTree("Filelist::Options") if Options['Help']: usage() - session = DBConn().session() suite_arch = session.query(SuiteArchitecture) threadpool = ThreadPool() for suite_name in utils.split_args(Options['Suite']):