Skip to content

Commit

Permalink
Fix issue with syncying (#18)
Browse files Browse the repository at this point in the history
  • Loading branch information
sethkor authored Nov 9, 2020
1 parent 92a2db7 commit bc765da
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions list.go
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@ func (bl *BucketLister) listObjects(withSize bool) error {
if aerr, ok := err.(awserr.Error); ok {
switch aerr.Code() {
default:
fmt.Println(aerr.Error())
logger.Fatal(aerr.Error())
}
} else {
Expand Down
4 changes: 2 additions & 2 deletions s3sync.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ func (sy *BucketSyncer) syncFileToS3() {
wg.Wait()
for file := range sy.files {
copyFile := true
if details, ok := sy.destMap[file.path[sy.sourceLength:]]; ok {
if details, ok := sy.destMap[file.path]; ok {
if details.lastModified.After(file.info.ModTime()) && *details.size == file.info.Size() {
copyFile = false
}
Expand Down Expand Up @@ -174,7 +174,7 @@ func (sy *BucketSyncer) syncObjToFile(wg *sync.WaitGroup) func(item []*s3.Object

for _, object := range item {
copyObj := true
if details, ok := sy.destMap[basePath+(*object.Key)]; ok {
if details, ok := sy.destMap[*object.Key]; ok {
if details.lastModified.After(*object.LastModified) {
if *details.size == *object.Size {
copyObj = false
Expand Down

0 comments on commit bc765da

Please sign in to comment.