attache 1.1.0 → 1.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/attache/backup.rb +6 -2
- data/lib/attache/delete.rb +2 -3
- data/lib/attache/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3b7c3810e65baa28f7f28fc97e86b4754d85484e
|
4
|
+
data.tar.gz: f3a701ece0b0a1594da9f664a7e48c8c8ad24509
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9b822e68fe861cd1161d9cefa51b9cd39d885aabb273e90618bc4c40858df791c1e73f76cb49332c02cf06f1570bd254d0025d83c06fc452eb71b192f18725b0
|
7
|
+
data.tar.gz: a7f05f0702b149cc1fa81805c8408686d485a9f6fcb5446623f4dc4a406c17f5985f4834b23778aee1cea1b67f2bc03b10d7a69358df6325d1083ca9f74c1ef6
|
data/lib/attache/backup.rb
CHANGED
@@ -12,10 +12,14 @@ class Attache::Backup < Attache::Base
|
|
12
12
|
|
13
13
|
if config.storage && config.bucket
|
14
14
|
sync_method = (ENV['BACKUP_ASYNC'] ? :async : :send)
|
15
|
+
threads = []
|
15
16
|
params['paths'].to_s.split("\n").each do |relpath|
|
16
|
-
|
17
|
-
|
17
|
+
threads << Thread.new do
|
18
|
+
Attache.logger.info "BACKUP remote #{relpath}"
|
19
|
+
config.send(sync_method, :backup_file, relpath: relpath)
|
20
|
+
end
|
18
21
|
end
|
22
|
+
threads.each(&:join)
|
19
23
|
end
|
20
24
|
[200, config.headers_with_cors, []]
|
21
25
|
else
|
data/lib/attache/delete.rb
CHANGED
@@ -10,9 +10,8 @@ class Attache::Delete < Attache::Base
|
|
10
10
|
params = request.params
|
11
11
|
return config.unauthorized unless config.authorized?(params)
|
12
12
|
|
13
|
+
threads = []
|
13
14
|
params['paths'].to_s.split("\n").each do |relpath|
|
14
|
-
threads = []
|
15
|
-
|
16
15
|
if Attache.cache
|
17
16
|
threads << Thread.new do
|
18
17
|
Attache.logger.info "DELETING local #{relpath}"
|
@@ -32,8 +31,8 @@ class Attache::Delete < Attache::Base
|
|
32
31
|
config.backup.async(:storage_destroy, relpath: relpath)
|
33
32
|
end
|
34
33
|
end
|
35
|
-
threads.each(&:join)
|
36
34
|
end
|
35
|
+
threads.each(&:join)
|
37
36
|
[200, config.headers_with_cors, []]
|
38
37
|
else
|
39
38
|
@app.call(env)
|
data/lib/attache/version.rb
CHANGED