Skip to content

Commit

Permalink
added method for setting start method as spawn
Browse files Browse the repository at this point in the history
  • Loading branch information
amofakhar committed Oct 31, 2024
1 parent ddb0037 commit 7e07411
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pipelinewise/cli/multiprocess.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@ class Process(multiprocessing.Process):
"""
def __init__(self, *args, **kwargs):
multiprocessing.Process.__init__(self, *args, **kwargs)
multiprocessing.freeze_support()
multiprocessing.set_start_method('spawn', force=True)

self._pconn, self._cconn = multiprocessing.Pipe()
self._exception = None

Expand All @@ -31,3 +28,6 @@ def exception(self):
if self._pconn.poll():
self._exception = self._pconn.recv()
return self._exception

def set_start_method_as_spawn(self):
multiprocessing.set_start_method('spawn', force=True)
1 change: 1 addition & 0 deletions pipelinewise/cli/pipelinewise.py
Original file line number Diff line number Diff line change
Expand Up @@ -1403,6 +1403,7 @@ def do_sync_tables(self, fastsync_stream_ids=None):
self._reset_state_file_for_partial_sync(selected_tables)
partial_sync_process = Process(
target=self.sync_tables_partial_sync, args=(selected_tables['partial_sync'],))
partial_sync_process.set_start_method_as_spawn()
partial_sync_process.start()
processes_list.append(partial_sync_process)

Expand Down

0 comments on commit 7e07411

Please sign in to comment.