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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 89128cc8f6345b6db994fc9e24c23624b7537568
4
- data.tar.gz: 0955b9d3e50ac4761e53babc1e03e4e9c644aa82
3
+ metadata.gz: 361fb1b313b057028b848c5459f6b78949d9e017
4
+ data.tar.gz: 0a12681343204dc62437c57b6865184d9ad3bebe
5
5
  SHA512:
6
- metadata.gz: 5272d12de6b7daec945993b084b248e5012a6e9be086e7898be0188099cacd2ab2396d69763b6d8a08157bbbbd8bc12835799e9539a70d03bd57e08d4a413700
7
- data.tar.gz: 3de9ac8f1d18016e27cb92800d30d05cca1920f38b13ef99c7534d81b37be900c8ea1796f6583b6822fe6830543e4ed8f0cf4a90fe95885fcd2627c2cdee59c3
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
- if Sidekiq::Scheduler.dynamic
42
- schedule_hash.each do |name, job_spec|
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
- # reloads the schedule from redis
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,5 +1,5 @@
1
1
  module SidekiqScheduler
2
2
 
3
- VERSION = '1.2.1'
3
+ VERSION = '1.2.2'
4
4
 
5
5
  end
@@ -1,14 +1,14 @@
1
1
  module SidekiqScheduler
2
- # Hook into *Sidekiq::Web* Sinatra app which adds a new "/recurring-jobs" page
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, "recurring_jobs.erb"))
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["Recurring Jobs"] = "recurring-jobs"
19
+ Sidekiq::Web.tabs['Recurring Jobs'] = 'recurring-jobs'
@@ -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.1
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-16 00:00:00.000000000 Z
12
+ date: 2015-10-19 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: sidekiq