mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-08-20 13:23:24 -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
|
@ -490,4 +490,8 @@ class MonitorDatabase(object):
|
|||
# Get the last insert row id
|
||||
result = self.select_single(query="SELECT last_insert_rowid() AS last_id")
|
||||
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