sidekiq-scheduler 2.0.9 → 2.0.10

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: 0f7d8c790cf456b0a62f67d543f1c7532f21e16b
4
- data.tar.gz: ca1112b924897da7d6d06d72e071ea63a92ac8e8
3
+ metadata.gz: 28711a6519af87dbfd27167ac41f003848c64bf2
4
+ data.tar.gz: f056bd26bfbc6ff0cc85b1eaa5426e96ec87c0ee
5
5
  SHA512:
6
- metadata.gz: 666ed752c0a891f3ad99af53402ff3274e881dc0540d79d0025c191cdcb6d80d73066d4e9c4021f85c0e04d4d65ecb6a63d41e2b4d6b0420f58070ab791b28b2
7
- data.tar.gz: f8dec2ee3b6add1cd02bd6760dc58fc49fc65cef3b1ae1a01891fb77e5fd535c9052ab78c98f21c5a396bbe30e457466a92bcf17dbf104c6e5be631879aa2f63
6
+ metadata.gz: f4bf1f9fbd8d31be38929bc6f8986f142e66a6e09fdabe011dd3ea912232de27b472c4be069c303b35a49cf7a394fa7f503c6c4053a71540d402a39c85191e6d
7
+ data.tar.gz: bbc4ca2d403a216973b6d95551de01af1c78d482e8464720b487a6cdafdb2d6204b63cc4f70aec7a4597856d0b5fe84bdf164a917fcd6c275e43d68def4a0361
data/README.md CHANGED
@@ -81,7 +81,7 @@ if Rails.env == 'production' && (defined?(Rails::Server) || defined?(Unicorn))
81
81
  Sidekiq.configure_server do |config|
82
82
 
83
83
  config.on(:startup) do
84
- Sidekiq.schedule = YAML.load_file(File.expand_path('../../config/scheduler.yml', __FILE__))
84
+ Sidekiq.schedule = YAML.load_file(File.expand_path('../../scheduler.yml', __FILE__))
85
85
  Sidekiq::Scheduler.reload_schedule!
86
86
  end
87
87
  end
@@ -156,7 +156,7 @@ require 'sidekiq/scheduler'
156
156
 
157
157
  Sidekiq.configure_server do |config|
158
158
  config.on(:startup) do
159
- Sidekiq.schedule = YAML.load_file(File.expand_path("../../config/scheduler.yml", __FILE__))
159
+ Sidekiq.schedule = YAML.load_file(File.expand_path('../../sidekiq_scheduler.yml', __FILE__))
160
160
  Sidekiq::Scheduler.reload_schedule!
161
161
  end
162
162
  end
@@ -166,11 +166,11 @@ If you are running a non Rails project you should add code to load the workers c
166
166
 
167
167
  ```ruby
168
168
  require 'sidekiq/scheduler'
169
- Dir[File.expand_path('../lib/workers/*.rb', __FILE__)].each do |file| load file; end
169
+ Dir[File.expand_path('../../../lib/workers/*.rb', __FILE__)].each do |file| load file; end
170
170
 
171
171
  Sidekiq.configure_server do |config|
172
172
  config.on(:startup) do
173
- Sidekiq.schedule = YAML.load_file(File.expand_path("../../config/scheduler.yml", __FILE__))
173
+ Sidekiq.schedule = YAML.load_file(File.expand_path("../../scheduler.yml", __FILE__))
174
174
  Sidekiq::Scheduler.reload_schedule!
175
175
  end
176
176
  end
@@ -1,3 +1,4 @@
1
+ require 'hashwithindifferentaccess'
1
2
  require 'rufus/scheduler'
2
3
  require 'thwait'
3
4
  require 'sidekiq/util'
@@ -60,7 +61,7 @@ module Sidekiq
60
61
  logger.info 'Schedule empty! Set Sidekiq.schedule' if Sidekiq.schedule.empty?
61
62
 
62
63
 
63
- @@scheduled_jobs = {}
64
+ @@scheduled_jobs = HashWithIndifferentAccess.new
64
65
 
65
66
  Sidekiq.schedule.each do |name, config|
66
67
  if !listened_queues_only || enabled_queue?(config['queue'])
@@ -1,3 +1,4 @@
1
+ require 'hashwithindifferentaccess'
1
2
  require 'multi_json'
2
3
 
3
4
  module SidekiqScheduler
@@ -117,7 +118,7 @@ module SidekiqScheduler
117
118
  private
118
119
 
119
120
  def prepare_schedule(schedule_hash)
120
- prepared_hash = {}
121
+ prepared_hash = HashWithIndifferentAccess.new
121
122
  schedule_hash.each do |name, job_spec|
122
123
  job_spec = job_spec.dup
123
124
  job_spec['class'] = name unless job_spec.key?('class') || job_spec.key?(:class)
@@ -1,5 +1,5 @@
1
1
  module SidekiqScheduler
2
2
 
3
- VERSION = '2.0.9'
3
+ VERSION = '2.0.10'
4
4
 
5
5
  end
@@ -16,7 +16,7 @@ module SidekiqScheduler
16
16
  app.get '/recurring-jobs/:name/enqueue' do
17
17
  schedule = Sidekiq.get_schedule(params[:name])
18
18
  Sidekiq::Scheduler.enqueue_job(schedule)
19
- redirect '/recurring-jobs'
19
+ redirect "#{root_path}recurring-jobs"
20
20
  end
21
21
  end
22
22
  end
@@ -0,0 +1,11 @@
1
+ zh-cn:
2
+ recurring_jobs: 周期作业
3
+ name: 名称
4
+ description: 描述
5
+ interval: 间隔
6
+ class: 类
7
+ queue: 队列
8
+ arguments: 参数
9
+ enqueue_now: 立即执行
10
+ next_time: 下次执行时间
11
+ no_next_time: 已无后续作业
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: 2.0.9
4
+ version: 2.0.10
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: 2016-09-15 00:00:00.000000000 Z
12
+ date: 2016-09-30 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: sidekiq
@@ -81,6 +81,20 @@ dependencies:
81
81
  - - '>='
82
82
  - !ruby/object:Gem::Version
83
83
  version: 1.4.0
84
+ - !ruby/object:Gem::Dependency
85
+ name: hashwithindifferentaccess
86
+ requirement: !ruby/object:Gem::Requirement
87
+ requirements:
88
+ - - '>='
89
+ - !ruby/object:Gem::Version
90
+ version: '0'
91
+ type: :runtime
92
+ prerelease: false
93
+ version_requirements: !ruby/object:Gem::Requirement
94
+ requirements:
95
+ - - '>='
96
+ - !ruby/object:Gem::Version
97
+ version: '0'
84
98
  - !ruby/object:Gem::Dependency
85
99
  name: rake
86
100
  requirement: !ruby/object:Gem::Requirement
@@ -239,6 +253,7 @@ files:
239
253
  - web/views/recurring_jobs.erb
240
254
  - web/locales/cs.yml
241
255
  - web/locales/en.yml
256
+ - web/locales/zh-cn.yml
242
257
  - web/locales/es.yml
243
258
  - MIT-LICENSE
244
259
  - Rakefile