hirefire-resource 1.0.7 → 1.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/hirefire/macro/delayed_job.rb +16 -25
- data/lib/hirefire/macro/deprecated/delayed_job.rb +3 -3
- data/lib/hirefire/macro/good_job.rb +2 -2
- data/lib/hirefire/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6ff7b6e9b3b7208480e0d3374e9aceba0c22ced18582d04e9aa4fda185df1753
|
4
|
+
data.tar.gz: 4528ab8e1528521c07e7d7a53f3d40d42a0a6de05d0b61c6e7f390ca03ed10b0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9cf97173b237ab2bc6ee5810a96fef55e0144331ccad0f750ae9e8edfcc7ef2715507e64bd1a4ae2019eb566ea7c8bb2fdba50cc6146f52824ed02e3212429b3
|
7
|
+
data.tar.gz: 2befdcc2d1a2fd0b3fc664ddff1417e47ebfef5f4e64241c031511fc30c85061e8272395b8eca58e482ff0b0844a816e99242e21191d450347adcf3406128fea
|
data/CHANGELOG.md
CHANGED
@@ -27,20 +27,15 @@ module HireFire
|
|
27
27
|
# HireFire::Macro::Delayed::Job.job_queue_latency(:default, :mailer)
|
28
28
|
def job_queue_latency(*queues)
|
29
29
|
queues = normalize_queues(queues, allow_empty: true)
|
30
|
+
query = ::Delayed::Job.where(failed_at: nil).order(run_at: :asc)
|
30
31
|
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
case mapper
|
39
|
-
when :active_record
|
40
|
-
query = query.where(queue: queues)
|
41
|
-
when :mongoid
|
42
|
-
query = query.in(queue: queues.to_a)
|
43
|
-
end
|
32
|
+
case mapper
|
33
|
+
when :active_record
|
34
|
+
query = query.where("run_at <= ?", Time.now)
|
35
|
+
query = query.where(queue: queues) if queues.any?
|
36
|
+
when :mongoid
|
37
|
+
query = query.where(run_at: {"$lte" => Time.now})
|
38
|
+
query = query.in(queue: queues.to_a) if queues.any?
|
44
39
|
end
|
45
40
|
|
46
41
|
if (job = query.first)
|
@@ -65,19 +60,15 @@ module HireFire
|
|
65
60
|
# HireFire::Macro::Delayed::Job.job_queue_size(:default, :mailer)
|
66
61
|
def job_queue_size(*queues)
|
67
62
|
queues = normalize_queues(queues, allow_empty: true)
|
63
|
+
query = ::Delayed::Job.where(failed_at: nil)
|
68
64
|
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
when :active_record
|
77
|
-
query = query.where(queue: queues)
|
78
|
-
when :mongoid
|
79
|
-
query = query.in(queue: queues.to_a)
|
80
|
-
end
|
65
|
+
case mapper
|
66
|
+
when :active_record
|
67
|
+
query = query.where("run_at <= ?", Time.now)
|
68
|
+
query = query.where(queue: queues) if queues.any?
|
69
|
+
when :mongoid
|
70
|
+
query = query.where(run_at: {"$lte" => Time.now})
|
71
|
+
query = query.in(queue: queues.to_a) if queues.any?
|
81
72
|
end
|
82
73
|
|
83
74
|
query.count
|
@@ -33,9 +33,9 @@ module HireFire
|
|
33
33
|
|
34
34
|
case options[:mapper]
|
35
35
|
when :active_record
|
36
|
-
query = ::Delayed::Job.where(failed_at: nil,
|
37
|
-
query = query.where(priority
|
38
|
-
query = query.where(priority
|
36
|
+
query = ::Delayed::Job.where(failed_at: nil).where("run_at <= ?", Time.now.utc)
|
37
|
+
query = query.where("priority >= ?", options[:min_priority]) if options.key?(:min_priority)
|
38
|
+
query = query.where("priority <= ?", options[:max_priority]) if options.key?(:max_priority)
|
39
39
|
query = query.where(queue: queues) unless queues.empty?
|
40
40
|
query.count
|
41
41
|
when :active_record_2
|
@@ -29,7 +29,7 @@ module HireFire
|
|
29
29
|
query = query.where(queue_name: queues) if queues.any?
|
30
30
|
query = query.where(performed_at: nil)
|
31
31
|
query = query.where.not(error_event: discarded_enum).or(query.where(error_event: nil)) if error_event_supported?
|
32
|
-
query = query.where(scheduled_at
|
32
|
+
query = query.where("scheduled_at <= ?", Time.now).or(query.where(scheduled_at: nil))
|
33
33
|
query = query.order(scheduled_at: :asc, created_at: :asc)
|
34
34
|
|
35
35
|
if (job = query.first)
|
@@ -57,7 +57,7 @@ module HireFire
|
|
57
57
|
query = query.where(queue_name: queues) if queues.any?
|
58
58
|
query = query.where(performed_at: nil)
|
59
59
|
query = query.where.not(error_event: discarded_enum).or(query.where(error_event: nil)) if error_event_supported?
|
60
|
-
query = query.where(scheduled_at
|
60
|
+
query = query.where("scheduled_at <= ?", Time.now).or(query.where(scheduled_at: nil))
|
61
61
|
query.count
|
62
62
|
end
|
63
63
|
end
|
data/lib/hirefire/version.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hirefire-resource
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael van Rooijen
|
8
8
|
bindir: bin
|
9
9
|
cert_chain: []
|
10
|
-
date:
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
11
11
|
dependencies:
|
12
12
|
- !ruby/object:Gem::Dependency
|
13
13
|
name: appraisal
|
@@ -84,7 +84,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
84
84
|
- !ruby/object:Gem::Version
|
85
85
|
version: '0'
|
86
86
|
requirements: []
|
87
|
-
rubygems_version: 3.6.
|
87
|
+
rubygems_version: 3.6.9
|
88
88
|
specification_version: 4
|
89
89
|
summary: HireFire integration library for Ruby applications
|
90
90
|
test_files: []
|