pairRenamer reads Objects~s on in and attempts to rename them, otherwise it sends them out if they need transferring.
(in *pipe, out *pipe, fraction int, wg *sync.WaitGroup)
| 465 | // pairRenamer reads Objects~s on in and attempts to rename them, |
| 466 | // otherwise it sends them out if they need transferring. |
| 467 | func (s *syncCopyMove) pairRenamer(in *pipe, out *pipe, fraction int, wg *sync.WaitGroup) { |
| 468 | defer wg.Done() |
| 469 | for { |
| 470 | pair, ok := in.GetMax(s.inCtx, fraction) |
| 471 | if !ok { |
| 472 | return |
| 473 | } |
| 474 | src := pair.Src |
| 475 | if !s.tryRename(src) { |
| 476 | // pass on if not renamed |
| 477 | fs.Debugf(src, "Need to transfer - No matching file found at Destination") |
| 478 | ok = out.Put(s.inCtx, pair) |
| 479 | if !ok { |
| 480 | return |
| 481 | } |
| 482 | } |
| 483 | } |
| 484 | } |
| 485 | |
| 486 | // pairCopyOrMove reads Objects on in and moves or copies them. |
| 487 | func (s *syncCopyMove) pairCopyOrMove(ctx context.Context, in *pipe, fdst fs.Fs, fraction int, wg *sync.WaitGroup) { |