Skip to content

Commit 466b4b5

Browse files
committed
Need an exit handler for all redis
1 parent 1058aae commit 466b4b5

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

flowmachine/flowmachine/core/context.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,9 @@ def bind_context(
195195
db.set(connection)
196196
executor.set(executor_pool)
197197
redis_connection.set(redis_conn)
198+
from flowmachine.core.init import _register_exit_handlers
199+
200+
_register_exit_handlers(redis_conn)
198201

199202

200203
@contextmanager
@@ -224,6 +227,9 @@ def context(connection: Connection, executor_pool: Executor, redis_conn: StrictR
224227
db_token = db.set(connection)
225228
redis_token = redis_connection.set(redis_conn)
226229
executor_token = executor.set(executor_pool)
230+
from flowmachine.core.init import _register_exit_handlers
231+
232+
_register_exit_handlers(redis_conn)
227233
try:
228234
yield
229235
finally:

0 commit comments

Comments
 (0)