MCPcopy Create free account
hub / github.com/pydio/cells / Capture

Method Capture

common/sync/task/sync.go:247–282  ·  view source on GitHub ↗
(ctx context.Context, targetFolder string)

Source from the content-addressed store, hash-verified

245}
246
247func (s *Sync) Capture(ctx context.Context, targetFolder string) error {
248
249 source, _ := model.AsPathSyncSource(s.Source)
250 targetAsSource, _ := model.AsPathSyncSource(s.Target)
251
252 if s.Direction == model.DirectionBi && s.snapshotFactory != nil {
253
254 leftSnap, err := s.snapshotFactory.Load(source)
255 if err != nil {
256 return err
257 }
258 if e := s.walkToJSON(ctx, leftSnap, filepath.Join(targetFolder, "snap-source.json")); e != nil {
259 return e
260 }
261
262 rightSnap, err := s.snapshotFactory.Load(targetAsSource)
263 if err != nil {
264 return err
265 }
266 if e := s.walkToJSON(ctx, rightSnap, filepath.Join(targetFolder, "snap-target.json")); e != nil {
267 return e
268 }
269
270 }
271
272 if e := s.walkToJSON(ctx, source, filepath.Join(targetFolder, "source.json")); e != nil {
273 return e
274 }
275
276 if e := s.walkToJSON(ctx, targetAsSource, filepath.Join(targetFolder, "target.json")); e != nil {
277 return e
278 }
279
280 return nil
281
282}
283
284func (s *Sync) RootStats(ctx context.Context, useSnapshots bool) (map[string]*model.EndpointRootStat, error) {
285

Callers

nothing calls this directly

Calls 4

walkToJSONMethod · 0.95
AsPathSyncSourceFunction · 0.92
LoadMethod · 0.65
JoinMethod · 0.45

Tested by

no test coverage detected