Skip to content

Commit ebf2fc3

Browse files
committed
[FIX] [droidapi]: close db sessions on update endpoints
1 parent 2ca2e9c commit ebf2fc3

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

src/droidapi/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
__author__ = "Anna-Sophie Zaitsewa"
22
__email__ = "[email protected]"
3-
__version__ = "0.1.0"
3+
__version__ = "0.1.5"
44

55
import os
66

src/droidapi/endpoints/update.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ def update_push(device: str, buildtype: str, build_id: str):
5151
update_model = update_from_form(request.form, file, filename, device, buildtype, build_id)
5252
session.add(update_model)
5353
session.commit()
54+
session.close()
5455
return {"status": "ok"}, 201
5556

5657

@@ -77,4 +78,5 @@ def update_get(device: str, buildtype: str, build_id: str):
7778
.order_by(Update.timestamp)).first()
7879
if next_update is None: # No updates
7980
return dict(response=list())
81+
session.close()
8082
return dict(response=[next_update.to_dict()])

0 commit comments

Comments
 (0)