mirror of
https://github.com/element-hq/synapse.git
synced 2026-10-22 19:44:06 +00:00
Stop real threadpool for test DB pool before replacing it with threadless test implementation (#20272)
This commit is contained in:
1 parent
360ab6e002
commit
c9b61fc2a3
2 files changed
+8
-1
No files matched your search
+7
-1
@@ -889,9 +889,15 @@ def make_fake_db_pool(
|
||||
|
||||
pool.runWithConnection = runWithConnection # type: ignore[method-assign]
|
||||
pool.runInteraction = runInteraction # type: ignore[assignment]
|
||||
# Replace the thread pool with a threadless 'thread' pool
|
||||
|
||||
# First, stop the original thread pool.
|
||||
pool.threadpool.stop()
|
||||
# Then, replace it with a threadless 'thread' pool
|
||||
pool.threadpool = ThreadPool(reactor)
|
||||
|
||||
# Start it up.
|
||||
pool.running = True
|
||||
|
||||
return pool
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user