Skip to content

Commit

Permalink
Import order fix and update to patch detection.
Browse files Browse the repository at this point in the history
  • Loading branch information
alecpm committed Jan 13, 2025
1 parent a2bf479 commit f17bb5f
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions dlgr/griduniverse/gevent_patch.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@
# isort: on

# This definitely belongs in dallinger.data
import psycopg2 # noqa
from contextlib import contextmanager # noqa

import psycopg2 # noqa
from dallinger import data # noqa

is_patched = getattr(data, "_patched", False)
is_patched = getattr(data, "_paused_thread", False)


@contextmanager
Expand All @@ -30,5 +31,5 @@ def _patched_copy_db_to_csv(dsn, path, scrub_pii=False):
with _paused_thread():
return _orig_copy_db_to_csv(dsn, path, scrub_pii)

data._patched = True
data._paused_thread = _paused_thread
data.copy_db_to_csv = _patched_copy_db_to_csv

0 comments on commit f17bb5f

Please sign in to comment.