Skip to content

Commit 1a1a581

Browse files
author
jojoliang
committed
update multicopy
1 parent 18ecdbd commit 1a1a581

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

object_part.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -371,6 +371,10 @@ func copyworker(ctx context.Context, s *ObjectService, jobs <-chan *CopyJobs, re
371371
results <- &copyres
372372
break
373373
}
374+
if resp != nil && resp.StatusCode < 499 {
375+
results <- &copyres
376+
break
377+
}
374378
time.Sleep(10 * time.Millisecond)
375379
continue
376380
}
@@ -465,6 +469,12 @@ func (s *ObjectService) MultiCopy(ctx context.Context, name string, sourceURL st
465469
partOpt := &ObjectCopyPartOptions{
466470
XCosCopySource: u,
467471
}
472+
if opt.OptCopy != nil && opt.OptCopy.ObjectCopyHeaderOptions != nil {
473+
partOpt.XCosCopySourceIfModifiedSince = opt.OptCopy.XCosCopySourceIfModifiedSince
474+
partOpt.XCosCopySourceIfUnmodifiedSince = opt.OptCopy.XCosCopySourceIfUnmodifiedSince
475+
partOpt.XCosCopySourceIfMatch = opt.OptCopy.XCosCopySourceIfMatch
476+
partOpt.XCosCopySourceIfNoneMatch = opt.OptCopy.XCosCopySourceIfNoneMatch
477+
}
468478
job := &CopyJobs{
469479
Name: name,
470480
RetryTimes: 3,

0 commit comments

Comments
 (0)