que-scheduler 4.2.1 → 4.2.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: 8d92cf3d8ebdf259e1710f12bd18a4c8659487db9a9aef74abc8adc5003d41e3
4
- data.tar.gz: 3f0444f62191a9e21d83d2aa3e8d31e2c360d8aa29855cac7c6e3a85a453354f
3
+ metadata.gz: e73846d81092ac0bacd4a3c854a3610bde40c8c4a5289728f42b59a5ef7833bf
4
+ data.tar.gz: 01e41964ee78f56cf90836457a5f439d0bc5185466890e5fcbbcbe4e77306041
5
5
  SHA512:
6
- metadata.gz: c92abb1259bec07700f14bc38f87513d664dab477a8c1c77112dc3850b807ce7ecc277dbe352bdcb1df1a5098758537a664ded7a59887b4c9e8b9f35c04019d8
7
- data.tar.gz: '080de57bec485640cff2f458c4462cd1ff13646851f2212273829195c4da3014df3675197c1d08e11e89bbcbdd68af1a951561837f0c89926a3baf1346b5cddb'
6
+ metadata.gz: 49bd076fb802ef81ad445d4dd668bd144a0d313aeee04988cb5bae8ebd9061955ac19c30efe46085f7453bb6dfd20f04b63c4225f6360407a46afefc8b833391
7
+ data.tar.gz: 1d4074dda7344d003140ed4b2e513702ffc8386620d236df8602a660f1fa1209d5f324d4f840bb17434b7164f5785b02d93ee4cfef08c2e055625ec675634fe8
data/README.md CHANGED
@@ -310,6 +310,13 @@ A full changelog can be found here: [CHANGELOG.md](https://github.com/hlascelles
310
310
 
311
311
  Your [postgres](https://www.postgresql.org/) database must be at least version 9.5.0.
312
312
 
313
+ Ruby 2.6 and above is supported. Ruby 2.5 currently still currently works but is unsupported.
314
+
315
+ Using que 0.x with Rails 6 needs a patch to support it.
316
+ See the patch and how to use it here: https://github.com/que-rb/que/issues/247#issuecomment-595258236
317
+ If that patch is included then que-scheduler will work. This setup is tested, but is not supported.
318
+
319
+
313
320
  ## Inspiration
314
321
 
315
322
  This gem was inspired by the makers of the excellent [Que](https://github.com/chanks/que) job scheduler gem.
@@ -324,3 +331,4 @@ This gem was inspired by the makers of the excellent [Que](https://github.com/ch
324
331
  * @krzyzak
325
332
  * @papodaca
326
333
  * @ajoneil
334
+ * @ippachi
@@ -86,7 +86,7 @@ module Que
86
86
  # queue name is only supported for a subrange of ActiveJob versions. Print this out as a
87
87
  # warning.
88
88
  if queue &&
89
- Que::Scheduler::ToEnqueue.active_job_loaded? &&
89
+ Que::Scheduler::ToEnqueue.active_job_defined? &&
90
90
  job_class < ::ActiveJob::Base &&
91
91
  Que::Scheduler::ToEnqueue.active_job_version < Gem::Version.create("6.0.3")
92
92
  puts <<~ERR
@@ -13,7 +13,7 @@ DECLARE
13
13
  BEGIN
14
14
  IF OLD.job_class = 'Que::Scheduler::SchedulerJob' THEN
15
15
  IF NOT que_scheduler_check_job_exists() THEN
16
- raise exception 'Deletion of que_scheduler job % prevented. Deleting the que_scheduler job is almost certainly a mistake.', OLD.job_id;
16
+ raise exception 'Deletion of que_scheduler job prevented. Deleting the que_scheduler job is almost certainly a mistake.';
17
17
  END IF;
18
18
  END IF;
19
19
  RETURN OLD;
@@ -36,10 +36,9 @@ module Que
36
36
  end
37
37
 
38
38
  def from_hash(config_hash)
39
- config_hash.to_h do |name, defined_job_hash|
40
- name_str = name.to_s
41
- [name_str, hash_item_to_defined_job(name_str, defined_job_hash)]
42
- end
39
+ config_hash
40
+ .map { |name, defined_job_hash| hash_item_to_defined_job(name.to_s, defined_job_hash) }
41
+ .index_by(&:name)
43
42
  end
44
43
 
45
44
  def hash_item_to_defined_job(name, defined_job_hash_in)
@@ -22,8 +22,8 @@ module Que
22
22
  type_from_job_class(job_class).present?
23
23
  end
24
24
 
25
- def active_job_loaded?
26
- !!active_job_version
25
+ def active_job_defined?
26
+ Object.const_defined?("ActiveJob")
27
27
  end
28
28
 
29
29
  def active_job_version
@@ -54,7 +54,7 @@ module Que
54
54
  hash = {
55
55
  ::Que::Job => QueJobType,
56
56
  }
57
- hash[::ActiveJob::Base] = ActiveJobType if ToEnqueue.active_job_loaded?
57
+ hash[::ActiveJob::Base] = ActiveJobType if ToEnqueue.active_job_defined?
58
58
  hash
59
59
  end
60
60
  end
@@ -1,5 +1,5 @@
1
1
  module Que
2
2
  module Scheduler
3
- VERSION = "4.2.1".freeze
3
+ VERSION = "4.2.2".freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: que-scheduler
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.2.1
4
+ version: 4.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Harry Lascelles
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-02-03 00:00:00.000000000 Z
11
+ date: 2022-02-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -404,7 +404,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
404
404
  - !ruby/object:Gem::Version
405
405
  version: '0'
406
406
  requirements: []
407
- rubygems_version: 3.2.7
407
+ rubygems_version: 3.1.6
408
408
  signing_key:
409
409
  specification_version: 4
410
410
  summary: A cron scheduler for Que