canvas-jobs 0.9.4 → 0.9.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/delayed/lifecycle.rb +3 -2
- data/lib/delayed/version.rb +1 -1
- data/lib/delayed/worker.rb +14 -1
- data/spec/gemfiles/32.gemfile.lock +1 -1
- data/spec/gemfiles/40.gemfile.lock +1 -1
- data/spec/gemfiles/41.gemfile.lock +1 -1
- data/spec/gemfiles/42.gemfile.lock +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 32d69dcda463a3ce29b8ff9284868b46c824e3f2
|
4
|
+
data.tar.gz: 9f06f47a35aa855dbc84f5378ba0bb55f0d3a8e4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c85759b2243f6c81285841c6fdf0fe1bddea1fb7ef11d0c33a71870726961ab5a151adb7c807604801d8bc6dc15f209c83248c34522df41f05c6121b35e787a1
|
7
|
+
data.tar.gz: e96532599f39295f4acb34536c506c91770a681597ad3e37a145fd0bed91d14b20fb6e4835c54c40908a425badd069df430ecf9f498c481ae1dbdfa0747bda4b
|
data/lib/delayed/lifecycle.rb
CHANGED
data/lib/delayed/version.rb
CHANGED
data/lib/delayed/worker.rb
CHANGED
@@ -34,6 +34,19 @@ class Worker
|
|
34
34
|
@max_job_count = options[:worker_max_job_count].to_i
|
35
35
|
@max_memory_usage = options[:worker_max_memory_usage].to_i
|
36
36
|
@job_count = 0
|
37
|
+
|
38
|
+
app = Rails.application
|
39
|
+
if app && !app.config.cache_classes
|
40
|
+
Delayed::Worker.lifecycle.around(:perform) do |&block|
|
41
|
+
reload = app.config.reload_classes_only_on_change != true || app.reloaders.map(&:updated?).any?
|
42
|
+
ActionDispatch::Reloader.prepare! if reload
|
43
|
+
begin
|
44
|
+
block.call
|
45
|
+
ensure
|
46
|
+
ActionDispatch::Reloader.cleanup! if reload
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
37
50
|
end
|
38
51
|
|
39
52
|
def name=(name)
|
@@ -69,7 +82,7 @@ class Worker
|
|
69
82
|
say "Stopping worker", :info
|
70
83
|
rescue => e
|
71
84
|
Rails.logger.fatal("Child process died: #{e.inspect}") rescue nil
|
72
|
-
|
85
|
+
self.class.Lifecycle.run_callbacks(:exceptional_exit, self, e) { }
|
73
86
|
ensure
|
74
87
|
Delayed::Job.clear_locks!(name)
|
75
88
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: canvas-jobs
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tobias Luetke
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-10-
|
12
|
+
date: 2014-10-22 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: after_transaction_commit
|