@@ -262,8 +262,12 @@ func (c *Client) GetRestoreByOpID(ctx context.Context, opid string) (*RestoreMet
262
262
return restore .GetRestoreMetaByOPID (ctx , c .conn , opid )
263
263
}
264
264
265
- func (c * Client ) SyncFromStorage (ctx context.Context ) (CommandID , error ) {
266
- opid , err := ctrl .SendResync (ctx , c .conn )
265
+ func (c * Client ) SyncFromStorage (ctx context.Context , skipRestores bool ) (CommandID , error ) {
266
+ var opts * ctrl.ResyncCmd
267
+ if skipRestores {
268
+ opts = & ctrl.ResyncCmd {SkipRestores : true }
269
+ }
270
+ opid , err := ctrl .SendResync (ctx , c .conn , opts )
267
271
return CommandID (opid .String ()), err
268
272
}
269
273
@@ -272,12 +276,12 @@ func (c *Client) SyncFromExternalStorage(ctx context.Context, name string) (Comm
272
276
return NoOpID , errors .New ("name is not provided" )
273
277
}
274
278
275
- opid , err := ctrl .SendSyncMetaFrom (ctx , c .conn , name )
279
+ opid , err := ctrl .SendResync (ctx , c .conn , & ctrl. ResyncCmd { Name : name } )
276
280
return CommandID (opid .String ()), err
277
281
}
278
282
279
283
func (c * Client ) SyncFromAllExternalStorages (ctx context.Context ) (CommandID , error ) {
280
- opid , err := ctrl .SendSyncMetaFrom (ctx , c .conn , "" )
284
+ opid , err := ctrl .SendResync (ctx , c .conn , & ctrl. ResyncCmd { All : true } )
281
285
return CommandID (opid .String ()), err
282
286
}
283
287
@@ -286,12 +290,12 @@ func (c *Client) ClearSyncFromExternalStorage(ctx context.Context, name string)
286
290
return NoOpID , errors .New ("name is not provided" )
287
291
}
288
292
289
- opid , err := ctrl .SendClearMetaFrom (ctx , c .conn , name )
293
+ opid , err := ctrl .SendResync (ctx , c .conn , & ctrl. ResyncCmd { Name : name , Clear : true } )
290
294
return CommandID (opid .String ()), err
291
295
}
292
296
293
297
func (c * Client ) ClearSyncFromAllExternalStorages (ctx context.Context ) (CommandID , error ) {
294
- opid , err := ctrl .SendClearMetaFrom (ctx , c .conn , "" )
298
+ opid , err := ctrl .SendResync (ctx , c .conn , & ctrl. ResyncCmd { All : true , Clear : true } )
295
299
return CommandID (opid .String ()), err
296
300
}
297
301
0 commit comments