s3_meta_sync 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b85122789e5f9115e5e5feae13687496fe84afc6
4
- data.tar.gz: 934425dbaa4f5555e418f6ccaade64144d888b99
3
+ metadata.gz: d7642bf36775b6d4208777739adb5bc3f569f5a0
4
+ data.tar.gz: fa9e52f99fd14dc3fb7ae8b45aa6fb05e539954c
5
5
  SHA512:
6
- metadata.gz: 3ea26c334b2aceda1df5f55cf17e66c5cb1f3a5cfb2d5246a09059f6bfc9246f17b7eb24680f492a461a40ebb9b98644b5fdb40cccf027fdf3ef93544219e6d8
7
- data.tar.gz: 1067bb5ff41eae7fed797b291bdeb936cb19bf7060bf4b7d36ea46ea5ef5994653c54d1715f8e764a7ba821e40aed7e05c1c22ea3e8c3d1c89fe1c5cba672558
6
+ metadata.gz: 8975619183d2678b7aea13118fe3ade6d5f7d6e3492f5e663b64f65392005c814a4e8be96f57705e061243c29e888b874e0db1ac887f656112e3bf1df163e345
7
+ data.tar.gz: 503dd14f0784246ac2ac636dc86ae544421d7baa98d41c259812dfc84226cd4b8162481567fb2c51f4036b748ac73e781a7a1b28f32b2eabb3299bfcd9171c75
checksums.yaml.gz.sig CHANGED
Binary file
data.tar.gz.sig CHANGED
Binary file
data/lib/s3_meta_sync.rb CHANGED
@@ -5,11 +5,14 @@ require "digest/md5"
5
5
  require "optparse"
6
6
  require "fileutils"
7
7
 
8
- # need to require these or upload in multiple threads will fail on systems with high load
9
8
  require "aws/s3"
10
- require "aws/s3/s3_object"
11
- require "aws/core/response"
12
- require "aws/s3/object_collection"
9
+
10
+ if RUBY_VERSION < "2.0.0"
11
+ # need to require these or upload in multiple threads will fail on systems with high load
12
+ require "aws/s3/s3_object"
13
+ require "aws/core/response"
14
+ require "aws/s3/object_collection"
15
+ end
13
16
 
14
17
  module S3MetaSync
15
18
  RemoteWithoutMeta = Class.new(Exception)
@@ -142,13 +145,13 @@ module S3MetaSync
142
145
  def in_multiple_threads(data)
143
146
  threads = [@config[:parallel] || 10, data.size].min
144
147
  data = data.dup
145
- threads.times do
148
+ (0...threads).to_a.map do
146
149
  Thread.new do
147
150
  while slice = data.shift
148
151
  yield slice
149
152
  end
150
153
  end
151
- end
154
+ end.each(&:join)
152
155
  end
153
156
 
154
157
  def log(text, important=false)
@@ -1,3 +1,3 @@
1
1
  module S3MetaSync
2
- VERSION = "0.2.0"
2
+ VERSION = "0.2.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: s3_meta_sync
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Grosser
metadata.gz.sig CHANGED
Binary file