s3-recursive-acl
s3-recursive-acl copied to clipboard
Fix not waiting reliably for all updates to complete
trafficstars
Due to WaitGroup.Add being called inside the goroutine the program does not reliably wait for all updates to complete before exiting.
Fixed by moving WaitGroup.Add outside of the goroutine.
Can be reproduced by testing with only a small number of objects:
$ AWS_PROFILE=default ./s3-recursive-acl --bucket foo --region bar --path baz/ --acl public-read
Successfully updated permissions on 3 objects
Note that there is no output "Updating ..."
Output after applying the fix:
$ AWS_PROFILE=default ./s3-recursive-acl --bucket foo --region bar --path baz/ --acl public-read
Updating 'baz/two'
Updating 'baz/one'
Updating 'baz/three'
Successfully updated permissions on 3 objects