sidekiq-scheduler 2.2.1 → 2.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: ac3ac2c861cfb11bbe7e875ad7ed7cff7822c99b
4
- data.tar.gz: 542352c4b0ed726ac98c4fe80a80c3f1e5280d88
3
+ metadata.gz: 2747b49a61187194593a74c6cdba9979d26fa99a
4
+ data.tar.gz: 3cda4ae1544bff66d97b7a94503a75aca57a237f
5
5
  SHA512:
6
- metadata.gz: 62ae98b53be7b7d25562d9ed8c0e16579cdcaa1fcdee4c75def8ba2f5c68496ac853487030577eb52feb6bdc6f883ab127f9f651eafb769589ad6612a0383722
7
- data.tar.gz: bf5ef6b12451881a3be4ea14a6ced7fb1e384a870e1f608e6130a0fd51e7821e9d799f7db324ba07c9b6cf687e61c9f8b4bf9d8dd1d9572316c6092290430387
6
+ metadata.gz: fc793b476d9a19bbc541dedef091e52ffabf08d88800c4a423121e9181d6042b39bd06498bec1c98dc3763b7ee4bf6b0f13e43896bf7d58d672d3570f5039776
7
+ data.tar.gz: 97da3f5c4e75468877f59e713407554364befe57b8891371dab4b17387b2f18cbba633695b28cbb99e53f6f63ac090ee3ae3bd64abf2875062f49db71cf45d84
data/README.md CHANGED
@@ -223,7 +223,7 @@ To load the schedule:
223
223
 
224
224
  ``` ruby
225
225
  require 'sidekiq'
226
- require 'sidekiq/scheduler'
226
+ require 'sidekiq-scheduler'
227
227
 
228
228
  Sidekiq.configure_server do |config|
229
229
  config.on(:startup) do
@@ -285,6 +285,18 @@ from the `config.time_zone` value, make sure it's the right format, e.g. with:
285
285
  ActiveSupport::TimeZone.find_tzinfo(Rails.configuration.time_zone).name
286
286
  ```
287
287
 
288
+ ## Notes about connection pooling
289
+
290
+ If you're configuring your own Redis connection pool, you need to make sure the size is adequate to be inclusive of both Sidekiq's own connection pool and Rufus Scheduler's.
291
+
292
+ That's a minimum of `concurrency` + 5 (per the [Sidekiq wiki](https://github.com/mperham/sidekiq/wiki/Using-Redis#complete-control)) + `Rufus::Scheduler::MAX_WORK_THREADS` (28 as of this writing; per the [Rufus README](https://github.com/jmettraux/rufus-scheduler#max_work_threads)), for a total of 58 with the default `concurrency` of 25.
293
+
294
+ You can also override the thread pool size in Rufus Scheduler by setting e.g.:
295
+
296
+ ```
297
+ Sidekiq::Scheduler.rufus_scheduler_options = { max_work_threads: 5 }
298
+ ```
299
+
288
300
  ## Notes about running on Multiple Hosts
289
301
 
290
302
  Under normal conditions, `cron` and `at` jobs are pushed once regardless of the number of `sidekiq-scheduler` running instances,
@@ -311,6 +323,18 @@ run Sidekiq::Web
311
323
 
312
324
  ![Sidekiq Web Integration](https://github.com/moove-it/sidekiq-scheduler/raw/master/images/recurring-jobs-ui-tab.png)
313
325
 
326
+ ## ActiveJob integration
327
+
328
+ When using sidekiq-scheduler with ActiveJob your jobs can just extend `ApplicationJob` as usual, without the `require` and `include` boilerplate. Under the hood Rails will load up the scheduler and include the worker module for you.
329
+
330
+ ```rb
331
+ class HelloWorld < ApplicationJob
332
+ def perform
333
+ puts 'Hello world'
334
+ end
335
+ end
336
+ ```
337
+
314
338
  ## The Spring preloader and Testing your initializer via Rails console
315
339
 
316
340
  If you're pulling in your schedule from a YML file via an initializer as shown, be aware that the Spring application preloader included with Rails will interefere with testing via the Rails console.
@@ -331,7 +355,8 @@ something like this in an initializer:
331
355
 
332
356
  ``` ruby
333
357
  # config/initializers/sidekiq_scheduler.rb
334
- require 'sidekiq/scheduler'
358
+ require 'sidekiq'
359
+ require 'sidekiq-scheduler'
335
360
 
336
361
  puts "Sidekiq.server? is #{Sidekiq.server?.inspect}"
337
362
  puts "defined?(Rails::Server) is #{defined?(Rails::Server).inspect}"
@@ -201,8 +201,10 @@ module SidekiqScheduler
201
201
 
202
202
  # Stops old rufus scheduler and creates a new one. Returns the new
203
203
  # rufus scheduler
204
- def clear_schedule!
205
- rufus_scheduler.stop
204
+ #
205
+ # @param [Symbol] stop_option The option to be passed to Rufus::Scheduler#stop
206
+ def clear_schedule!(stop_option = :wait)
207
+ rufus_scheduler.stop(stop_option)
206
208
  @rufus_scheduler = nil
207
209
  @@scheduled_jobs = {}
208
210
  rufus_scheduler
@@ -224,6 +226,7 @@ module SidekiqScheduler
224
226
 
225
227
  if schedule_changes.size > 0
226
228
  logger.info 'Updating schedule'
229
+
227
230
  Sidekiq.reload_schedule!
228
231
  schedule_changes.each do |schedule_name|
229
232
  if Sidekiq.schedule.keys.include?(schedule_name)
@@ -1,5 +1,5 @@
1
1
  module SidekiqScheduler
2
2
 
3
- VERSION = '2.2.1'
3
+ VERSION = '2.2.2'
4
4
 
5
5
  end
@@ -0,0 +1,14 @@
1
+ pl:
2
+ recurring_jobs: Okresowe
3
+ name: Nazwa
4
+ description: Opis
5
+ interval: Interwał
6
+ class: Klasa
7
+ queue: Kolejka
8
+ arguments: Argumenty
9
+ enqueue_now: Zakolejkuj teraz
10
+ last_time: Ostatnie wystąpienie
11
+ next_time: Następne wystąpienie
12
+ no_next_time: to zadanie nie zostanie już wywołane
13
+ disable: Wyłącz
14
+ enable: Włącz
@@ -0,0 +1,14 @@
1
+ pt-BR:
2
+ recurring_jobs: Jobs Recorrentes
3
+ name: Nome
4
+ description: Descrição
5
+ interval: Intervalo
6
+ class: Classe
7
+ queue: Fila
8
+ arguments: Argumentos
9
+ enqueue_now: Enfileirar agora
10
+ last_time: Última execução
11
+ next_time: Próxima execução
12
+ no_next_time: Não há mais execuçoẽs
13
+ disable: Desativar
14
+ enable: Ativar
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.2.1
4
+ version: 2.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: 2018-01-25 00:00:00.000000000 Z
12
+ date: 2018-05-15 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: sidekiq
@@ -258,6 +258,8 @@ files:
258
258
  - web/locales/fr.yml
259
259
  - web/locales/it.yml
260
260
  - web/locales/nl.yml
261
+ - web/locales/pl.yml
262
+ - web/locales/pt-BR.yml
261
263
  - web/locales/ru.yml
262
264
  - web/locales/sv.yml
263
265
  - web/locales/zh-cn.yml