diff --git a/apolpi.py b/apolpi.py index dd2e791..f4b12ad 100644 --- a/apolpi.py +++ b/apolpi.py @@ -103,11 +103,12 @@ def _fetch(): - roles = db.engine.execute(QUERY) - out = [] - for role in roles: - out.append(dict(zip(columns, role))) - return out + with db.engine.connect() as connection: + roles = connection.execute(QUERY) + out = [] + for role in roles: + out.append(dict(zip(columns, role))) + return out @app.route("/organism/findAllOrganisms", methods=["GET", "POST"])