Skip to content

Commit

Permalink
ensure we reset engine across process
Browse files Browse the repository at this point in the history
  • Loading branch information
pablonyx committed Nov 10, 2024
1 parent 8983a2d commit 2117a17
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions backend/danswer/background/celery/apps/indexing.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from celery import Task
from celery.signals import celeryd_init
from celery.signals import worker_init
from celery.signals import worker_process_init
from celery.signals import worker_ready
from celery.signals import worker_shutdown

Expand Down Expand Up @@ -81,6 +82,11 @@ def on_worker_shutdown(sender: Any, **kwargs: Any) -> None:
app_base.on_worker_shutdown(sender, **kwargs)


@worker_process_init.connect
def init_worker(**kwargs: Any) -> None:
SqlEngine.reset_engine()


@signals.setup_logging.connect
def on_setup_logging(
loglevel: Any, logfile: Any, format: Any, colorize: Any, **kwargs: Any
Expand Down

0 comments on commit 2117a17

Please sign in to comment.