We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0729b3a commit ed4a23dCopy full SHA for ed4a23d
homeassistant/components/recorder/pool.py
@@ -12,6 +12,7 @@
12
from sqlalchemy.pool import (
13
ConnectionPoolEntry,
14
NullPool,
15
+ PoolProxiedConnection,
16
SingletonThreadPool,
17
StaticPool,
18
)
@@ -119,6 +120,12 @@ def _do_get_db_connection_protected(self) -> ConnectionPoolEntry:
119
120
121
return NullPool._create_connection(self) # noqa: SLF001
122
123
+ def connect(self) -> PoolProxiedConnection:
124
+ """Return a connection from the pool."""
125
+ if threading.get_ident() in self.recorder_and_worker_thread_ids:
126
+ return super().connect()
127
+ return NullPool.connect(self)
128
+
129
130
class MutexPool(StaticPool):
131
"""A pool which prevents concurrent accesses from multiple threads.
0 commit comments