Skip to content

Commit

Permalink
added context manager
Browse files Browse the repository at this point in the history
  • Loading branch information
BuzzCutNorman committed Mar 1, 2024
1 parent 2e0eca3 commit 81ef4dc
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions singer_sdk/tap_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from enum import Enum

import click
from joblib import Parallel, delayed
from joblib import Parallel, delayed, parallel_config

from singer_sdk._singerlib import Catalog, StateMessage
from singer_sdk.configuration._dict_config import merge_missing_config_jsonschema
Expand Down Expand Up @@ -476,10 +476,8 @@ def sync_all(self) -> None:
def _sync_one(stream: Stream) -> None:
self.sync_one(stream)

# with parallel_backend(backend="multiprocessing", n_jobs=2):
Parallel(n_jobs=-1)(
delayed(_sync_one)(stream) for stream in self.streams.values()
)
with parallel_config(backend="loky", n_jobs=-2):
Parallel()(delayed(_sync_one)(stream) for stream in self.streams.values())

# this second loop is needed for all streams to print out their costs
# including child streams which are otherwise skipped in the loop above
Expand Down

0 comments on commit 81ef4dc

Please sign in to comment.