saviour 0.6.5 → 0.6.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/saviour/life_cycle.rb +15 -8
- data/lib/saviour/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e01220554bae6d136bace3b491f366aa5e5f8a8e6b853b1d19f5fe2ee194f7ac
|
4
|
+
data.tar.gz: cce3bf80da5aad0f7056422f9e30d9595f5c2b597f899346f09f0b615e0c5ce3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0b9b2682ffb7d3584853b3cb3ceca37cbae5f95a9802eabbe5d3df80a5de79810dbb3f26e5cb29fdfcf2acb128a9cd8d9f459458e0dc43bf93c47ec1274af303
|
7
|
+
data.tar.gz: 0a94d1526dcbb231bb27feb1b47cd913dd668ee127e6ce41961a67d2cd14ff646a7f52b856d5dc2b2758c1e3ca59b12473f2a8b9227c5c1078d17cd860a90bbe
|
data/lib/saviour/life_cycle.rb
CHANGED
@@ -49,7 +49,7 @@ module Saviour
|
|
49
49
|
end
|
50
50
|
|
51
51
|
@new_path = @file.write(
|
52
|
-
|
52
|
+
before_write: ->(path) { dup_file.call if @current_path == path }
|
53
53
|
)
|
54
54
|
|
55
55
|
return unless @new_path
|
@@ -124,17 +124,18 @@ module Saviour
|
|
124
124
|
next unless @model.send(column).changed?
|
125
125
|
|
126
126
|
klass.new(
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
127
|
+
persistence_layer.read(column),
|
128
|
+
@model.send(column),
|
129
|
+
column,
|
130
|
+
ActiveRecord::Base.connection
|
131
131
|
)
|
132
132
|
end.compact
|
133
133
|
|
134
134
|
pool = Concurrent::FixedThreadPool.new(Saviour::Config.concurrent_workers)
|
135
|
+
|
135
136
|
futures = uploaders.map { |uploader|
|
136
137
|
Concurrent::Future.execute(executor: pool) {
|
137
|
-
if defined?(Rails)
|
138
|
+
if defined?(Rails) && Rails::VERSION::MAJOR < 6
|
138
139
|
Rails.application.executor.wrap { uploader.upload }
|
139
140
|
else
|
140
141
|
uploader.upload
|
@@ -142,13 +143,19 @@ module Saviour
|
|
142
143
|
}
|
143
144
|
}
|
144
145
|
|
145
|
-
|
146
|
+
work = -> {
|
146
147
|
futures.map do |x|
|
147
148
|
x.value.tap do
|
148
149
|
raise(x.reason) if x.rejected?
|
149
150
|
end
|
150
151
|
end.compact
|
151
|
-
|
152
|
+
}
|
153
|
+
|
154
|
+
result = if defined?(Rails) && Rails::VERSION::MAJOR < 6
|
155
|
+
ActiveSupport::Dependencies.interlock.permit_concurrent_loads(&work)
|
156
|
+
else
|
157
|
+
work.call
|
158
|
+
end
|
152
159
|
|
153
160
|
pool.shutdown
|
154
161
|
pool.wait_for_termination
|
data/lib/saviour/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: saviour
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Roger Campos
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-10-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|