activejob 5.0.7.2 → 5.1.0.beta1

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of activejob might be problematic. Click here for more details.

Files changed (37) hide show
  1. checksums.yaml +5 -5
  2. data/CHANGELOG.md +24 -221
  3. data/MIT-LICENSE +1 -1
  4. data/README.md +1 -1
  5. data/lib/active_job.rb +5 -5
  6. data/lib/active_job/arguments.rb +7 -19
  7. data/lib/active_job/base.rb +11 -9
  8. data/lib/active_job/callbacks.rb +3 -3
  9. data/lib/active_job/configured_job.rb +1 -1
  10. data/lib/active_job/core.rb +14 -9
  11. data/lib/active_job/enqueuing.rb +7 -32
  12. data/lib/active_job/exceptions.rb +122 -0
  13. data/lib/active_job/execution.rb +5 -2
  14. data/lib/active_job/gem_version.rb +3 -3
  15. data/lib/active_job/logging.rb +56 -56
  16. data/lib/active_job/queue_adapter.rb +14 -26
  17. data/lib/active_job/queue_adapters.rb +2 -2
  18. data/lib/active_job/queue_adapters/async_adapter.rb +4 -4
  19. data/lib/active_job/queue_adapters/backburner_adapter.rb +1 -1
  20. data/lib/active_job/queue_adapters/delayed_job_adapter.rb +1 -1
  21. data/lib/active_job/queue_adapters/qu_adapter.rb +3 -3
  22. data/lib/active_job/queue_adapters/que_adapter.rb +1 -1
  23. data/lib/active_job/queue_adapters/queue_classic_adapter.rb +4 -4
  24. data/lib/active_job/queue_adapters/resque_adapter.rb +5 -5
  25. data/lib/active_job/queue_adapters/sidekiq_adapter.rb +11 -11
  26. data/lib/active_job/queue_adapters/sneakers_adapter.rb +3 -3
  27. data/lib/active_job/queue_adapters/sucker_punch_adapter.rb +3 -3
  28. data/lib/active_job/queue_adapters/test_adapter.rb +13 -17
  29. data/lib/active_job/queue_name.rb +2 -3
  30. data/lib/active_job/queue_priority.rb +1 -2
  31. data/lib/active_job/railtie.rb +4 -4
  32. data/lib/active_job/test_case.rb +1 -1
  33. data/lib/active_job/test_helper.rb +78 -39
  34. data/lib/active_job/version.rb +1 -1
  35. data/lib/rails/generators/job/job_generator.rb +12 -12
  36. data/lib/rails/generators/job/templates/application_job.rb +5 -0
  37. metadata +9 -7
@@ -1,4 +1,4 @@
1
- require_relative 'gem_version'
1
+ require_relative "gem_version"
2
2
 
3
3
  module ActiveJob
4
4
  # Returns the version of the currently loaded Active Job as a <tt>Gem::Version</tt>
@@ -1,13 +1,13 @@
1
- require 'rails/generators/named_base'
1
+ require "rails/generators/named_base"
2
2
 
3
3
  module Rails # :nodoc:
4
4
  module Generators # :nodoc:
5
5
  class JobGenerator < Rails::Generators::NamedBase # :nodoc:
6
- desc 'This generator creates an active job file at app/jobs'
6
+ desc "This generator creates an active job file at app/jobs"
7
7
 
8
- class_option :queue, type: :string, default: 'default', desc: 'The queue name for the generated job'
8
+ class_option :queue, type: :string, default: "default", desc: "The queue name for the generated job"
9
9
 
10
- check_class_collision suffix: 'Job'
10
+ check_class_collision suffix: "Job"
11
11
 
12
12
  hook_for :test_framework
13
13
 
@@ -16,22 +16,22 @@ module Rails # :nodoc:
16
16
  end
17
17
 
18
18
  def create_job_file
19
- template 'job.rb', File.join('app/jobs', class_path, "#{file_name}_job.rb")
19
+ template "job.rb", File.join("app/jobs", class_path, "#{file_name}_job.rb")
20
20
 
21
21
  in_root do
22
- if self.behavior == :invoke && !File.exist?(application_job_file_name)
23
- template 'application_job.rb', application_job_file_name
22
+ if behavior == :invoke && !File.exist?(application_job_file_name)
23
+ template "application_job.rb", application_job_file_name
24
24
  end
25
25
  end
26
26
  end
27
27
 
28
28
  private
29
29
  def application_job_file_name
30
- @application_job_file_name ||= if mountable_engine?
31
- "app/jobs/#{namespaced_path}/application_job.rb"
32
- else
33
- 'app/jobs/application_job.rb'
34
- end
30
+ @application_job_file_name ||= if mountable_engine?
31
+ "app/jobs/#{namespaced_path}/application_job.rb"
32
+ else
33
+ "app/jobs/application_job.rb"
34
+ end
35
35
  end
36
36
  end
37
37
  end
@@ -1,4 +1,9 @@
1
1
  <% module_namespacing do -%>
2
2
  class ApplicationJob < ActiveJob::Base
3
+ # Automatically retry jobs that encountered a deadlock
4
+ # retry_on ActiveRecord::Deadlocked
5
+
6
+ # Most jobs are safe to ignore if the underlying records are no longer available
7
+ # discard_on ActiveJob::DeserializationError
3
8
  end
4
9
  <% end -%>
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activejob
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.0.7.2
4
+ version: 5.1.0.beta1
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Heinemeier Hansson
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-03-13 00:00:00.000000000 Z
11
+ date: 2017-02-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 5.0.7.2
19
+ version: 5.1.0.beta1
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - '='
25
25
  - !ruby/object:Gem::Version
26
- version: 5.0.7.2
26
+ version: 5.1.0.beta1
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: globalid
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -54,6 +54,7 @@ files:
54
54
  - lib/active_job/configured_job.rb
55
55
  - lib/active_job/core.rb
56
56
  - lib/active_job/enqueuing.rb
57
+ - lib/active_job/exceptions.rb
57
58
  - lib/active_job/execution.rb
58
59
  - lib/active_job/gem_version.rb
59
60
  - lib/active_job/logging.rb
@@ -96,11 +97,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
96
97
  version: 2.2.2
97
98
  required_rubygems_version: !ruby/object:Gem::Requirement
98
99
  requirements:
99
- - - ">="
100
+ - - ">"
100
101
  - !ruby/object:Gem::Version
101
- version: '0'
102
+ version: 1.3.1
102
103
  requirements: []
103
- rubygems_version: 3.0.1
104
+ rubyforge_project:
105
+ rubygems_version: 2.6.10
104
106
  signing_key:
105
107
  specification_version: 4
106
108
  summary: Job framework with pluggable queues.