@@ -36,6 +36,7 @@ class MultigridController:
3636 do_transfer : bool = True
3737 dummy_dc : bool = False
3838 force_mdoc_metadata : bool = True
39+ rsync_restarts : List [str ] = field (default_factory = lambda : [])
3940 rsync_processes : Dict [Path , RSyncer ] = field (default_factory = lambda : {})
4041 analysers : Dict [Path , Analyser ] = field (default_factory = lambda : {})
4142 data_collection_parameters : dict = field (default_factory = lambda : {})
@@ -103,7 +104,11 @@ def _start_rsyncer_multigrid(
103104 f"{ self ._environment .url .geturl ()} /instruments/{ self .instrument_name } /machine"
104105 ).json ()
105106 if destination_overrides .get (source ):
106- destination = destination_overrides [source ] + f"/{ extra_directory } "
107+ destination = (
108+ destination_overrides [source ]
109+ if str (source ) in self .rsync_restarts
110+ else destination_overrides [source ] + f"/{ extra_directory } "
111+ )
107112 else :
108113 for k , v in destination_overrides .items ():
109114 if Path (v ).name in source .parts :
@@ -134,6 +139,7 @@ def _start_rsyncer_multigrid(
134139 tag = tag ,
135140 limited = limited ,
136141 transfer = machine_data .get ("data_transfer_enabled" , True ),
142+ restarted = str (source ) in self .rsync_restarts ,
137143 )
138144 self .ws .send (json .dumps ({"message" : "refresh" }))
139145
@@ -175,6 +181,7 @@ def _start_rsyncer(
175181 tag : str = "" ,
176182 limited : bool = False ,
177183 transfer : bool = True ,
184+ restarted : bool = False ,
178185 ):
179186 log .info (f"starting rsyncer: { source } " )
180187 if self ._environment :
@@ -238,15 +245,21 @@ def rsync_result(update: RSyncerUpdate):
238245 ),
239246 secondary = True ,
240247 )
241- url = f"{ str (self ._environment .url .geturl ())} /sessions/{ str (self ._environment .murfey_session )} /rsyncer"
242- rsyncer_data = {
243- "source" : str (source ),
244- "destination" : destination ,
245- "session_id" : self .session_id ,
246- "transferring" : self .do_transfer or self ._environment .demo ,
247- "tag" : tag ,
248- }
249- requests .post (url , json = rsyncer_data )
248+ if restarted :
249+ restarted_url = (
250+ f"{ self .murfey_url } /sessions/{ self .session_id } /rsyncer_started"
251+ )
252+ capture_post (restarted_url , json = {"source" : str (source )})
253+ else :
254+ url = f"{ str (self ._environment .url .geturl ())} /sessions/{ str (self ._environment .murfey_session )} /rsyncer"
255+ rsyncer_data = {
256+ "source" : str (source ),
257+ "destination" : destination ,
258+ "session_id" : self .session_id ,
259+ "transferring" : self .do_transfer or self ._environment .demo ,
260+ "tag" : tag ,
261+ }
262+ requests .post (url , json = rsyncer_data )
250263 self ._environment .watchers [source ] = DirWatcher (source , settling_time = 30 )
251264
252265 if not self .analysers .get (source ) and analyse :
0 commit comments