mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-08-20 21:33:18 -07:00
Close database connection on garbage collection
This commit is contained in:
parent
330b8a3a82
commit
ac32297160
1 changed files with 5 additions and 1 deletions
|
@ -491,3 +491,7 @@ class MonitorDatabase(object):
|
||||||
result = self.select_single(query="SELECT last_insert_rowid() AS last_id")
|
result = self.select_single(query="SELECT last_insert_rowid() AS last_id")
|
||||||
if result:
|
if result:
|
||||||
return result.get('last_id', None)
|
return result.get('last_id', None)
|
||||||
|
|
||||||
|
def __del__(self):
|
||||||
|
# Close the database connection when object is garbage collected
|
||||||
|
self.connection.close()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue