[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[dak/master 3/3] Use the same session when getting pool entries, otherwise we can't do poolfile.location



Signed-off-by: Chris Lamb <lamby@debian.org>
---
 daklib/queue.py |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/daklib/queue.py b/daklib/queue.py
index 0b45b28..f64e8ae 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
 
-- 
1.6.3.3


Reply to: