sidekiq-scheduler 3.1.1 → 3.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/sidekiq-scheduler/redis_manager.rb +3 -3
- data/lib/sidekiq-scheduler/schedule.rb +3 -1
- data/lib/sidekiq-scheduler/scheduler.rb +1 -12
- data/lib/sidekiq-scheduler/utils.rb +11 -0
- data/lib/sidekiq-scheduler/version.rb +1 -1
- data/web/assets/stylesheets/recurring_jobs.css +4 -0
- data/web/views/recurring_jobs.erb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b8bddb1a9c6aeffceb3a1efde76cc88285a5a4ef2ea1e7e1ef85ac35b4e311f4
|
4
|
+
data.tar.gz: b88000d6771e9a5d88754dd753bf96dc142453ff170bf2fd11bbe1afc50de3fd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 444aa2319dfe4a4817348ed7cd8d92d3f11ca16ed04ac9b8c4b590c68d2c86ef7df27cab0a81d0c78c0a26000cdaaa332870d0ec644a59241d96c34ddc80b5e0
|
7
|
+
data.tar.gz: 32ecf78f608fbec6a2b017a88d1bd332f4af20931d55751ea44499af77a2df664ff71a57a3bce55dac2c8ded981fc960b96b67eb3076f7ab7c7d3b59baa77fc5
|
@@ -137,9 +137,9 @@ module SidekiqScheduler
|
|
137
137
|
def self.register_job_instance(job_name, time)
|
138
138
|
job_key = pushed_job_key(job_name)
|
139
139
|
registered, _ = Sidekiq.redis do |r|
|
140
|
-
r.pipelined do
|
141
|
-
|
142
|
-
|
140
|
+
r.pipelined do |pipeline|
|
141
|
+
pipeline.zadd(job_key, time.to_i, time.to_i)
|
142
|
+
pipeline.expire(job_key, REGISTERED_JOBS_THRESHOLD_IN_SECONDS)
|
143
143
|
end
|
144
144
|
end
|
145
145
|
|
@@ -140,7 +140,9 @@ module SidekiqScheduler
|
|
140
140
|
def infer_queue(klass)
|
141
141
|
klass = try_to_constantize(klass)
|
142
142
|
|
143
|
-
|
143
|
+
# ActiveJob uses queue_as when the job is created
|
144
|
+
# to determine the queue
|
145
|
+
if klass.respond_to?(:sidekiq_options) && !SidekiqScheduler::Utils.active_job_enqueue?(klass)
|
144
146
|
klass.sidekiq_options['queue']
|
145
147
|
end
|
146
148
|
end
|
@@ -161,7 +161,7 @@ module SidekiqScheduler
|
|
161
161
|
config['args'] = arguments_with_metadata(config['args'], scheduled_at: time.to_f)
|
162
162
|
end
|
163
163
|
|
164
|
-
if active_job_enqueue?(config['class'])
|
164
|
+
if SidekiqScheduler::Utils.active_job_enqueue?(config['class'])
|
165
165
|
SidekiqScheduler::Utils.enqueue_with_active_job(config)
|
166
166
|
else
|
167
167
|
SidekiqScheduler::Utils.enqueue_with_sidekiq(config)
|
@@ -307,17 +307,6 @@ module SidekiqScheduler
|
|
307
307
|
queues.empty? || queues.include?(job_queue)
|
308
308
|
end
|
309
309
|
|
310
|
-
# Returns true if the enqueuing needs to be done for an ActiveJob
|
311
|
-
# class false otherwise.
|
312
|
-
#
|
313
|
-
# @param [Class] klass the class to check is decendant from ActiveJob
|
314
|
-
#
|
315
|
-
# @return [Boolean]
|
316
|
-
def active_job_enqueue?(klass)
|
317
|
-
klass.is_a?(Class) && defined?(ActiveJob::Enqueuing) &&
|
318
|
-
klass.included_modules.include?(ActiveJob::Enqueuing)
|
319
|
-
end
|
320
|
-
|
321
310
|
# Convert the given arguments in the format expected to be enqueued.
|
322
311
|
#
|
323
312
|
# @param [Hash] config the options to be converted
|
@@ -68,6 +68,17 @@ module SidekiqScheduler
|
|
68
68
|
end
|
69
69
|
end
|
70
70
|
|
71
|
+
# Returns true if the enqueuing needs to be done for an ActiveJob
|
72
|
+
# class false otherwise.
|
73
|
+
#
|
74
|
+
# @param [Class] klass the class to check is decendant from ActiveJob
|
75
|
+
#
|
76
|
+
# @return [Boolean]
|
77
|
+
def self.active_job_enqueue?(klass)
|
78
|
+
klass.is_a?(Class) && defined?(ActiveJob::Enqueuing) &&
|
79
|
+
klass.included_modules.include?(ActiveJob::Enqueuing)
|
80
|
+
end
|
81
|
+
|
71
82
|
# Enqueues the job using the Sidekiq client.
|
72
83
|
#
|
73
84
|
# @param [Hash] config The job configuration
|
@@ -5,7 +5,7 @@
|
|
5
5
|
<div class="recurring-jobs">
|
6
6
|
<ul class="list-group">
|
7
7
|
<% @presented_jobs.each do |job| %>
|
8
|
-
<li class="list-group-item">
|
8
|
+
<li class="list-group-item <%= !job.enabled? && "list-group-item-disabled" %>">
|
9
9
|
<div class="title">
|
10
10
|
<div class="row">
|
11
11
|
<div class="col-xs-6">
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sidekiq-scheduler
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.
|
4
|
+
version: 3.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Morton Jonuschat
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2022-
|
12
|
+
date: 2022-04-18 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: sidekiq
|