mirror of
https://github.com/beetbox/beets.git
synced 2025-12-14 04:23:56 +01:00
Close all threads' connections
This commit is contained in:
parent
574f3bc732
commit
f1b81bc60c
1 changed files with 2 additions and 5 deletions
|
|
@ -734,14 +734,11 @@ class Database(object):
|
|||
return conn
|
||||
|
||||
def _close(self):
|
||||
"""Close the current thread's connection to the underlying
|
||||
SQLite database.
|
||||
"""Close the all connections to the underlying SQLite database.
|
||||
"""
|
||||
thread_id = threading.current_thread().ident
|
||||
with self._shared_map_lock:
|
||||
if thread_id in self._connections:
|
||||
self._connections[thread_id].close()
|
||||
del self._connections[thread_id]
|
||||
self._connections.clear()
|
||||
|
||||
@contextlib.contextmanager
|
||||
def _tx_stack(self):
|
||||
|
|
|
|||
Loading…
Reference in a new issue