]> git.donarmstrong.com Git - dak.git/blobdiff - dakweb/queries/suite.py
Close our SQLAlchemy sessions
[dak.git] / dakweb / queries / suite.py
index b5c0118c586ffc2d783eba7d1294f2927dedced9..245b879c8ea2c677f89f90d3e2b5922644f8aac1 100644 (file)
@@ -32,6 +32,8 @@ def suites():
                     'architectures': [x.arch_string for x in p.architectures],
                     'components': [x.component_name for x in p.components]})
 
+    s.close()
+
     return json.dumps(ret)
 
 QueryRegister().register_path('/suites', suites)
@@ -61,6 +63,7 @@ def suite(suite=None):
 
     if q.count() > 1:
         # This would mean dak is misconfigured
+        s.close()
         return bottle.HTTPError(503, 'Multiple suites found: configuration error')
     elif q.count() == 1:
         so = q[0]
@@ -69,6 +72,7 @@ def suite(suite=None):
         q = s.query(Suite).filter(Suite.codename == suite)
         if q.count() > 1:
             # This would mean dak is misconfigured
+            s.close()
             return bottle.HTTPError(503, 'Multiple suites found: configuration error')
         elif q.count() == 1:
             so = q[0]
@@ -81,6 +85,8 @@ def suite(suite=None):
               'architectures': [x.arch_string for x in so.architectures],
               'components': [x.component_name for x in so.components]}
 
+    s.close()
+
     return json.dumps(so)
 
 QueryRegister().register_path('/suite', suite)