Skip to content

Commit

Permalink
Need an exit handler for all redis
Browse files Browse the repository at this point in the history
  • Loading branch information
greenape committed Apr 26, 2022
1 parent 1058aae commit 466b4b5
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions flowmachine/flowmachine/core/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,9 @@ def bind_context(
db.set(connection)
executor.set(executor_pool)
redis_connection.set(redis_conn)
from flowmachine.core.init import _register_exit_handlers

_register_exit_handlers(redis_conn)


@contextmanager
Expand Down Expand Up @@ -224,6 +227,9 @@ def context(connection: Connection, executor_pool: Executor, redis_conn: StrictR
db_token = db.set(connection)
redis_token = redis_connection.set(redis_conn)
executor_token = executor.set(executor_pool)
from flowmachine.core.init import _register_exit_handlers

_register_exit_handlers(redis_conn)
try:
yield
finally:
Expand Down

0 comments on commit 466b4b5

Please sign in to comment.