sidekiq-scheduler 1.2.1 → 1.2.2
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/schedule.rb +8 -6
- data/lib/sidekiq-scheduler/version.rb +1 -1
- data/lib/sidekiq-scheduler/web.rb +4 -4
- data/lib/sidekiq/scheduler.rb +4 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 361fb1b313b057028b848c5459f6b78949d9e017
|
4
|
+
data.tar.gz: 0a12681343204dc62437c57b6865184d9ad3bebe
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 814400614b1fabde47d39503eb586dfcc0e4e881bef9531a3a0b5047015b932a202e3f5c0ea367b9f753c0458adfd4d2d5557cbd607ca4f5cd2e9d8b580e033a
|
7
|
+
data.tar.gz: ba567b96542baf134f78509f649201772730d79139a76812dea2ca7d5545d014281a5c1d7656dd8688185e1ce9858010fc4e8e8b2c22617eec5e25b808208c87
|
@@ -38,11 +38,10 @@ module SidekiqScheduler
|
|
38
38
|
def schedule=(schedule_hash)
|
39
39
|
schedule_hash = prepare_schedule(schedule_hash)
|
40
40
|
|
41
|
-
|
42
|
-
|
43
|
-
set_schedule(name, job_spec)
|
44
|
-
end
|
41
|
+
schedule_hash.each do |name, job_spec|
|
42
|
+
set_schedule(name, job_spec)
|
45
43
|
end
|
44
|
+
|
46
45
|
@schedule = schedule_hash
|
47
46
|
end
|
48
47
|
|
@@ -50,10 +49,13 @@ module SidekiqScheduler
|
|
50
49
|
@schedule ||= {}
|
51
50
|
end
|
52
51
|
|
53
|
-
#
|
52
|
+
# Reloads the schedule from Redis and return it.
|
53
|
+
#
|
54
|
+
# @return Hash
|
54
55
|
def reload_schedule!
|
55
56
|
@schedule = get_schedule
|
56
57
|
end
|
58
|
+
alias_method :schedule!, :reload_schedule!
|
57
59
|
|
58
60
|
# Retrive the schedule configuration for the given name
|
59
61
|
# if the name is nil it returns a hash with all the
|
@@ -121,4 +123,4 @@ module SidekiqScheduler
|
|
121
123
|
end
|
122
124
|
end
|
123
125
|
|
124
|
-
Sidekiq.extend SidekiqScheduler::Schedule
|
126
|
+
Sidekiq.extend SidekiqScheduler::Schedule
|
@@ -1,14 +1,14 @@
|
|
1
1
|
module SidekiqScheduler
|
2
|
-
# Hook into *Sidekiq::Web* Sinatra app which adds a new
|
2
|
+
# Hook into *Sidekiq::Web* Sinatra app which adds a new '/recurring-jobs' page
|
3
3
|
|
4
4
|
module Web
|
5
5
|
VIEW_PATH = File.expand_path('../../../web/views', __FILE__)
|
6
6
|
|
7
7
|
def self.registered(app)
|
8
8
|
app.get '/recurring-jobs' do
|
9
|
-
@schedule = Sidekiq.schedule
|
9
|
+
@schedule = Sidekiq.schedule!
|
10
10
|
|
11
|
-
erb File.read(File.join(VIEW_PATH,
|
11
|
+
erb File.read(File.join(VIEW_PATH, 'recurring_jobs.erb'))
|
12
12
|
end
|
13
13
|
end
|
14
14
|
end
|
@@ -16,4 +16,4 @@ end
|
|
16
16
|
|
17
17
|
require 'sidekiq/web' unless defined?(Sidekiq::Web)
|
18
18
|
Sidekiq::Web.register(SidekiqScheduler::Web)
|
19
|
-
Sidekiq::Web.tabs[
|
19
|
+
Sidekiq::Web.tabs['Recurring Jobs'] = 'recurring-jobs'
|
data/lib/sidekiq/scheduler.rb
CHANGED
@@ -9,12 +9,16 @@ module Sidekiq
|
|
9
9
|
|
10
10
|
# We expect rufus jobs to have #params
|
11
11
|
Rufus::Scheduler::Job.module_eval do
|
12
|
+
|
12
13
|
alias_method :params, :opts
|
14
|
+
|
13
15
|
end
|
14
16
|
|
15
17
|
class << self
|
18
|
+
|
16
19
|
# If set, will try to update the schedule in the loop
|
17
20
|
attr_accessor :dynamic
|
21
|
+
|
18
22
|
end
|
19
23
|
|
20
24
|
# the Rufus::Scheduler jobs that are scheduled
|
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: 1.2.
|
4
|
+
version: 1.2.2
|
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: 2015-10-
|
12
|
+
date: 2015-10-19 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: sidekiq
|