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 +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/lib/s3_meta_sync.rb +9 -6
- data/lib/s3_meta_sync/version.rb +1 -1
- metadata +1 -1
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d7642bf36775b6d4208777739adb5bc3f569f5a0
|
4
|
+
data.tar.gz: fa9e52f99fd14dc3fb7ae8b45aa6fb05e539954c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
11
|
-
|
12
|
-
require
|
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.
|
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)
|
data/lib/s3_meta_sync/version.rb
CHANGED
metadata
CHANGED
metadata.gz.sig
CHANGED
Binary file
|