-
-
Notifications
You must be signed in to change notification settings - Fork 813
Closed
Description
This issue in a plugin:
Was caused by this code, which means connections stick around even when a database should have been replaced:
datasette/datasette/database.py
Lines 280 to 286 in 53a3b3c
| def in_thread(): | |
| conn = getattr(connections, self.name, None) | |
| if not conn: | |
| conn = self.connect() | |
| self.ds._prepare_connection(conn, self.name) | |
| setattr(connections, self.name, conn) | |
| return fn(conn) |
The problem is that if you have a database with name dogs and you use remove_database() and then add_database() to try and replace it with a new database of the same name the existing threads continue to reference an old connection to that database.
Reactions are currently unavailable