From c629ed1c07ab3257926520c065bff763bb54f47d Mon Sep 17 00:00:00 2001 From: Chris Lamb Date: Thu, 29 Oct 2009 13:38:56 +0000 Subject: [PATCH] Use the same session when getting pool entries, otherwise we can't do poolfile.location Signed-off-by: Chris Lamb --- daklib/queue.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/daklib/queue.py b/daklib/queue.py index 0b45b284..f64e8ae6 100755 --- a/daklib/queue.py +++ b/daklib/queue.py @@ -1234,10 +1234,11 @@ class Upload(object): os.symlink(path, os.path.join(target_dir, filename)) return True + session = DBConn().session() found = False # Look in the pool - for poolfile in get_poolfile_like_name('/%s' % filename): + for poolfile in get_poolfile_like_name('/%s' % filename, session): poolfile_path = os.path.join( poolfile.location.path, poolfile.filename ) @@ -1246,6 +1247,8 @@ class Upload(object): found = True break + session.close() + if found: continue -- 2.39.5