Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/murfey/client/multigrid_control.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ def _finalise_rsyncer(self, source: Path):
finalise_thread = threading.Thread(
name=f"Controller finaliser thread ({source})",
target=self.rsync_processes[source].finalise,
kwargs={"thread": False},
daemon=True,
)
finalise_thread.start()
Expand Down
21 changes: 12 additions & 9 deletions src/murfey/client/rsync.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,18 +172,21 @@ def stop(self):
self.thread.join()
logger.debug("RSync thread stop completed")

def finalise(self):
def finalise(self, thread: bool = True):
self.stop()
self._remove_files = True
self._notify = False
self.thread = threading.Thread(
name=f"RSync finalisation {self._basepath}:{self._remote}",
target=self._process,
daemon=True,
)
for f in self._basepath.glob("**/*"):
self.queue.put(f)
self.stop()
if thread:
self.thread = threading.Thread(
name=f"RSync finalisation {self._basepath}:{self._remote}",
target=self._process,
daemon=True,
)
for f in self._basepath.glob("**/*"):
self.queue.put(f)
self.stop()
else:
self._transfer(list(self._basepath.glob("**/*")))

def enqueue(self, file_path: Path):
if not self._stopping:
Expand Down
Loading