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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 09c716227c64b63dd68ab787a2af74a625f8da29
4
- data.tar.gz: f7683091496f7afac5085bb7d38d0eac48a810ec
3
+ metadata.gz: 32d69dcda463a3ce29b8ff9284868b46c824e3f2
4
+ data.tar.gz: 9f06f47a35aa855dbc84f5378ba0bb55f0d3a8e4
5
5
  SHA512:
6
- metadata.gz: 262577e7b68a7bfd44cea42e3d1cacffb0f6bf4caa4df7ac7c230f560bb11e4f333ff0c19688820c8ce7a675638bbb57eb45c7a3e869f2b0d075553c690c6b26
7
- data.tar.gz: ef2c55f222a31b8a38069cb6177efe339251ed37690633a9f1dda4bded4df89de506169317da6ad2c1d3104b8a9c265c8d9432683b732b32dbec557d09bcb382
6
+ metadata.gz: c85759b2243f6c81285841c6fdf0fe1bddea1fb7ef11d0c33a71870726961ab5a151adb7c807604801d8bc6dc15f209c83248c34522df41f05c6121b35e787a1
7
+ data.tar.gz: e96532599f39295f4acb34536c506c91770a681597ad3e37a145fd0bed91d14b20fb6e4835c54c40908a425badd069df430ecf9f498c481ae1dbdfa0747bda4b
@@ -3,8 +3,9 @@ module Delayed
3
3
 
4
4
  class Lifecycle
5
5
  EVENTS = {
6
- :perform => [:worker, :job],
7
- :pop => [:worker],
6
+ :perform => [:worker, :job],
7
+ :pop => [:worker],
8
+ :exceptional_exit => [:worker, :exception],
8
9
  }
9
10
 
10
11
  def initialize
@@ -1,3 +1,3 @@
1
1
  module Delayed
2
- VERSION = "0.9.4"
2
+ VERSION = "0.9.5"
3
3
  end
@@ -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
- ErrorReport.log_exception(:delayed_jobs, e) rescue nil
85
+ self.class.Lifecycle.run_callbacks(:exceptional_exit, self, e) { }
73
86
  ensure
74
87
  Delayed::Job.clear_locks!(name)
75
88
  end
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ../../
3
3
  specs:
4
- canvas-jobs (0.9.3)
4
+ canvas-jobs (0.9.4)
5
5
  after_transaction_commit (= 1.0.1)
6
6
  rails (>= 3.2)
7
7
  redis (> 3.0)
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ../../
3
3
  specs:
4
- canvas-jobs (0.9.3)
4
+ canvas-jobs (0.9.4)
5
5
  after_transaction_commit (= 1.0.1)
6
6
  rails (>= 3.2)
7
7
  redis (> 3.0)
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ../../
3
3
  specs:
4
- canvas-jobs (0.9.3)
4
+ canvas-jobs (0.9.4)
5
5
  after_transaction_commit (= 1.0.1)
6
6
  rails (>= 3.2)
7
7
  redis (> 3.0)
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ../../
3
3
  specs:
4
- canvas-jobs (0.9.3)
4
+ canvas-jobs (0.9.4)
5
5
  after_transaction_commit (= 1.0.1)
6
6
  rails (>= 3.2)
7
7
  redis (> 3.0)
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
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-21 00:00:00.000000000 Z
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