good_job 3.3.1 → 3.3.2

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
  SHA256:
3
- metadata.gz: cabb124450eb5e88a460635fb4aa70f3e5a53406ded6554bb32018fa2aa890bc
4
- data.tar.gz: 0d83085806f8a1f30eff6136df4995f7982064b90a497ee56a4f8b9d922f4fbb
3
+ metadata.gz: 7b5dad621ffb6df8e754cc906eb748605d14525e7286f163f536c577d70f287c
4
+ data.tar.gz: 2f2973f6e21b7cf55ceb569cfff1bbf9fa1a579e544c7b96cae15c56cb890ce4
5
5
  SHA512:
6
- metadata.gz: 7f17d4379517d9909ac771c9920b3472b1d5bbb18ce45bd78b160f76eba6b6a1169e6b89ec044cd8f3c5ad93a311be45174bd43b99468c5ff9a5c4bad088263f
7
- data.tar.gz: 27f6aa3048d4035feb1e55b7cd4a3ba8410deb74ec9268fba23bac9a75c9db26bc3599d1f140bf68182b2f2307183013bc6601927a6eec19cab6051fcf03a927
6
+ metadata.gz: dbc0e6fe97519eabaee2f82f0de69cfbce24a928ba579ac57fd1b0c38b9693269a7b7bb69042d621a84fca224f2ec335bf9a5c2c7420a9e3e4cf9bbdf0f34460
7
+ data.tar.gz: b237d93f4741900bcc7263a754155328d31452cc040ee047d5bdca1dc0d0dbd9dfa416563dd70482d3d56f0bc73ef7d57b91a256760895a8ed9127cef2fb8127
data/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # Changelog
2
2
 
3
+ ## [v3.3.2](https://github.com/bensheldon/good_job/tree/v3.3.2) (2022-07-27)
4
+
5
+ [Full Changelog](https://github.com/bensheldon/good_job/compare/v3.3.1...v3.3.2)
6
+
7
+ **Fixed bugs:**
8
+
9
+ - Defer setting Adapter's execution mode until Rails initializes [\#683](https://github.com/bensheldon/good_job/pull/683) ([bensheldon](https://github.com/bensheldon))
10
+
3
11
  ## [v3.3.1](https://github.com/bensheldon/good_job/tree/v3.3.1) (2022-07-26)
4
12
 
5
13
  [Full Changelog](https://github.com/bensheldon/good_job/compare/v3.3.0...v3.3.1)
@@ -10,8 +10,6 @@ module GoodJob
10
10
  # @return [Array<GoodJob::Adapter>, nil]
11
11
  cattr_reader :instances, default: [], instance_reader: false
12
12
 
13
- attr_reader :execution_mode
14
-
15
13
  # @param execution_mode [Symbol, nil] specifies how and where jobs should be executed. You can also set this with the environment variable +GOOD_JOB_EXECUTION_MODE+.
16
14
  #
17
15
  # - +:inline+ executes jobs immediately in whatever process queued them (usually the web server process). This should only be used in test and development environments.
@@ -27,10 +25,10 @@ module GoodJob
27
25
  # - +production+ and all other environments: +:external+
28
26
  #
29
27
  def initialize(execution_mode: nil)
30
- @execution_mode = (execution_mode || GoodJob.configuration.execution_mode).to_sym
31
- GoodJob::Configuration.validate_execution_mode(@execution_mode)
32
- self.class.instances << self
28
+ @_execution_mode_override = execution_mode
29
+ GoodJob::Configuration.validate_execution_mode(@_execution_mode_override) if @_execution_mode_override
33
30
 
31
+ self.class.instances << self
34
32
  start_async if GoodJob.async_ready?
35
33
  end
36
34
 
@@ -94,6 +92,12 @@ module GoodJob
94
92
  @_async_started = false
95
93
  end
96
94
 
95
+ # This adapter's execution mode
96
+ # @return [Symbol, nil]
97
+ def execution_mode
98
+ @_execution_mode_override || GoodJob.configuration.execution_mode
99
+ end
100
+
97
101
  # Whether in +:async+ execution mode.
98
102
  # @return [Boolean]
99
103
  def execute_async?
@@ -104,7 +108,8 @@ module GoodJob
104
108
  # Whether in +:external+ execution mode.
105
109
  # @return [Boolean]
106
110
  def execute_externally?
107
- execution_mode == :external ||
111
+ execution_mode.nil? ||
112
+ execution_mode == :external ||
108
113
  (execution_mode.in?([:async, :async_server]) && !in_server_process?)
109
114
  end
110
115
 
@@ -0,0 +1,4 @@
1
+ module GoodJob
2
+ module Enqueing
3
+ end
4
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
  module GoodJob
3
3
  # GoodJob gem version.
4
- VERSION = '3.3.1'
4
+ VERSION = '3.3.2'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: good_job
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.3.1
4
+ version: 3.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ben Sheldon
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-07-26 00:00:00.000000000 Z
11
+ date: 2022-07-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activejob
@@ -426,6 +426,7 @@ files:
426
426
  - lib/good_job/daemon.rb
427
427
  - lib/good_job/dependencies.rb
428
428
  - lib/good_job/engine.rb
429
+ - lib/good_job/enqueuing.rb
429
430
  - lib/good_job/job_performer.rb
430
431
  - lib/good_job/log_subscriber.rb
431
432
  - lib/good_job/multi_scheduler.rb