attache 1.1.0 → 1.1.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: 8a5ec5e8b4431d1505fb6519428f01091da7a658
4
- data.tar.gz: 1bdfa46bee9d2015ff5afc0fd9caaff55bb3f5f2
3
+ metadata.gz: 3b7c3810e65baa28f7f28fc97e86b4754d85484e
4
+ data.tar.gz: f3a701ece0b0a1594da9f664a7e48c8c8ad24509
5
5
  SHA512:
6
- metadata.gz: 00659d9c0716246aa7c501dd6a37f8e6fd6a0e2c4e9ec23f17418f7536362f013ee05c885b9cbd74b7159b68ed12d33cb83326b4c1ff6ef8eca2b31ab46cb0fa
7
- data.tar.gz: 1b0cb02c0d32909d23f5b5cb120e5a463f0aaa323c9304367ed28fc6f4b9d884ff2ce085f2db99654cca892d01355e7a99e00bd7482a456f768ca63179cd70b2
6
+ metadata.gz: 9b822e68fe861cd1161d9cefa51b9cd39d885aabb273e90618bc4c40858df791c1e73f76cb49332c02cf06f1570bd254d0025d83c06fc452eb71b192f18725b0
7
+ data.tar.gz: a7f05f0702b149cc1fa81805c8408686d485a9f6fcb5446623f4dc4a406c17f5985f4834b23778aee1cea1b67f2bc03b10d7a69358df6325d1083ca9f74c1ef6
@@ -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
- Attache.logger.info "BACKUP remote #{relpath}"
17
- config.send(sync_method, :backup_file, relpath: relpath)
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
@@ -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)
@@ -1,3 +1,3 @@
1
1
  module Attache
2
- VERSION = "1.1.0"
2
+ VERSION = "1.1.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: attache
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - choonkeat