File tree Expand file tree Collapse file tree 2 files changed +13
-9
lines changed
Expand file tree Collapse file tree 2 files changed +13
-9
lines changed Original file line number Diff line number Diff line change @@ -159,6 +159,7 @@ def _finalise_rsyncer(self, source: Path):
159159 finalise_thread = threading .Thread (
160160 name = f"Controller finaliser thread ({ source } )" ,
161161 target = self .rsync_processes [source ].finalise ,
162+ kwargs = {"thread" : False },
162163 daemon = True ,
163164 )
164165 finalise_thread .start ()
Original file line number Diff line number Diff line change @@ -172,18 +172,21 @@ def stop(self):
172172 self .thread .join ()
173173 logger .debug ("RSync thread stop completed" )
174174
175- def finalise (self ):
175+ def finalise (self , thread : bool = True ):
176176 self .stop ()
177177 self ._remove_files = True
178178 self ._notify = False
179- self .thread = threading .Thread (
180- name = f"RSync finalisation { self ._basepath } :{ self ._remote } " ,
181- target = self ._process ,
182- daemon = True ,
183- )
184- for f in self ._basepath .glob ("**/*" ):
185- self .queue .put (f )
186- self .stop ()
179+ if thread :
180+ self .thread = threading .Thread (
181+ name = f"RSync finalisation { self ._basepath } :{ self ._remote } " ,
182+ target = self ._process ,
183+ daemon = True ,
184+ )
185+ for f in self ._basepath .glob ("**/*" ):
186+ self .queue .put (f )
187+ self .stop ()
188+ else :
189+ self ._transfer (list (self ._basepath .glob ("**/*" )))
187190
188191 def enqueue (self , file_path : Path ):
189192 if not self ._stopping :
You can’t perform that action at this time.
0 commit comments