sidekiq-scheduler 5.0.2 → 5.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: edad8a00a79398a6bec8ea7a3532fd866637eae6cf3bccea93f916d9dfaff394
4
- data.tar.gz: c81477cc85ba7cea519bb6b70f475a7b0b13b308eb4ef742bd08ed8e8221e755
3
+ metadata.gz: d26f3947b1ef031bc393203e79975cfcc5159d32f7ff3d07a1b3858621d167d4
4
+ data.tar.gz: f921936d4d0a8f9942e98cc67da8404738af852042e2f8b23e9c818be14c8b26
5
5
  SHA512:
6
- metadata.gz: 384c6fc946e29fefb46462b44aaa2f563a3a649b57556e317ca24b26ea70614e321e3b8547bd7e9559c267936c606e2ef80758d7b977c33baea09c415e29052b
7
- data.tar.gz: 3273a3ee2ca92eedab784cb3cfa36aea7f36767dab7a1148c034193256c09413cb78fda285cd0a4047e7e20ab0216be5a0e631dfc15423725a5174d87c85e18b
6
+ metadata.gz: 1fdea51e227d0eafcce6cc6973e9e9349788ffd3ff947c3967ca4eceae7fe4c47ec485a72194c36e11b623a3cfa372ba583d6305df57896d7c39fc6c3f687618
7
+ data.tar.gz: c217f9992d5cb3fcb78d11dae5273cccdae276fd2d6a7c1166b4faf6aae92ad3b8c2253af2f4f94fffca4027fe0c9ca6720386cb7406d592baa514b63ee5f6ef
data/CHANGELOG.md CHANGED
@@ -1,3 +1,11 @@
1
+ # 5.0.3
2
+
3
+ - [**FIX**] Fix "uppercase character in header name: Cache-Control" [#432](https://github.com/sidekiq-scheduler/sidekiq-scheduler/pull/432)
4
+ - [**ENHANCEMENT**] Add gd translation [#433](https://github.com/sidekiq-scheduler/sidekiq-scheduler/pull/433)
5
+ - [**ENHANCEMENT**] Add French translation [#435](https://github.com/sidekiq-scheduler/sidekiq-scheduler/pull/435)
6
+ - [**FIX**] Remove usage of deprecated Redis command `zrangebyscore` [#437](https://github.com/sidekiq-scheduler/sidekiq-scheduler/pull/437)
7
+ - [**ENHANCEMENT**] Add the ability to force a job args hash to be deconstructed to keyword arguments [#440](https://github.com/sidekiq-scheduler/sidekiq-scheduler/pull/440)
8
+
1
9
  # 5.0.2
2
10
 
3
11
  - [**FIX**] Fix YARD docblocks. [#427](https://github.com/sidekiq-scheduler/sidekiq-scheduler/pull/427)
data/README.md CHANGED
@@ -119,6 +119,25 @@ The schedule is configured through the `:scheduler:` -> `:schedule` config entry
119
119
 
120
120
  # Enable / disable a job. All jobs are enabled by default.
121
121
  enabled: true
122
+
123
+ # Deconstructs a hash defined as the `args` to keyword arguments.
124
+ #
125
+ # `flase` by default.
126
+ #
127
+ # Example
128
+ #
129
+ # my_job:
130
+ # cron: '0 0 * * * *'
131
+ # class: MyJob
132
+ # args: { foo: 'bar', hello: 'world' }
133
+ # keyword_argument: true
134
+ #
135
+ # class MyJob < ActiveJob::Base
136
+ # def perform(foo:, hello:)
137
+ # # ...
138
+ # end
139
+ # end
140
+ keyword_argument: true
122
141
  ```
123
142
 
124
143
  ### Schedule metadata
@@ -515,7 +534,7 @@ MIT License
515
534
 
516
535
  ## Copyright
517
536
 
518
- - Copyright 2021 - 2022 Marcelo Lauxen.
537
+ - Copyright 2021 - 2023 Marcelo Lauxen.
519
538
  - Copyright 2013 - 2022 Moove-IT.
520
539
  - Copyright 2012 Morton Jonuschat.
521
540
  - Some parts copyright 2010 Ben VandenBos.
@@ -10,5 +10,5 @@ if Sidekiq::VERSION >= '6.0.0'
10
10
  Sidekiq::Web.use Rack::Static, urls: ['/stylesheets-scheduler'],
11
11
  root: ASSETS_PATH,
12
12
  cascade: true,
13
- header_rules: [[:all, { 'Cache-Control' => 'public, max-age=86400' }]]
13
+ header_rules: [[:all, { 'cache-control' => 'public, max-age=86400' }]]
14
14
  end
@@ -106,7 +106,7 @@ module SidekiqScheduler
106
106
  #
107
107
  # @return [Array] array with all the changed job names
108
108
  def self.get_schedule_changes(from, to)
109
- Sidekiq.redis { |r| r.zrangebyscore(schedules_changed_key, from, "(#{to}") }
109
+ SidekiqScheduler::SidekiqAdapter.redis_zrangebyscore(schedules_changed_key, from, "(#{to}")
110
110
  end
111
111
 
112
112
  # Register a schedule change for a given job
@@ -76,5 +76,15 @@ module SidekiqScheduler
76
76
  end
77
77
  end
78
78
  end
79
+
80
+ def self.redis_zrangebyscore(key, from, to)
81
+ Sidekiq.redis do |r|
82
+ if SIDEKIQ_GTE_7_0_0
83
+ r.zrange(key, from, to, "BYSCORE")
84
+ else
85
+ r.zrangebyscore(key, from, to)
86
+ end
87
+ end
88
+ end
79
89
  end
80
90
  end
@@ -60,9 +60,11 @@ module SidekiqScheduler
60
60
  # @param [Array, Hash] args The parameters passed to the klass initializer
61
61
  #
62
62
  # @return [Object] instance of the class klass
63
- def self.initialize_active_job(klass, args)
63
+ def self.initialize_active_job(klass, args, keyword_argument = false)
64
64
  if args.is_a?(Array)
65
65
  klass.new(*args)
66
+ elsif args.is_a?(Hash) && keyword_argument
67
+ klass.new(**symbolize_keys(args))
66
68
  else
67
69
  klass.new(args)
68
70
  end
@@ -94,7 +96,7 @@ module SidekiqScheduler
94
96
  queue: config['queue']
95
97
  }.keep_if { |_, v| !v.nil? }
96
98
 
97
- initialize_active_job(config['class'], config['args']).enqueue(options)
99
+ initialize_active_job(config['class'], config['args'], config['keyword_argument']).enqueue(options)
98
100
  end
99
101
 
100
102
  # Removes the hash values associated to the rufus metadata keys.
@@ -1,3 +1,3 @@
1
1
  module SidekiqScheduler
2
- VERSION = "5.0.2"
2
+ VERSION = "5.0.3"
3
3
  end
data/web/locales/fr.yml CHANGED
@@ -7,7 +7,10 @@ fr:
7
7
  queue: Queue
8
8
  arguments: Arguments
9
9
  enqueue_now: Ajouter à la queue
10
- next_time: Quand
10
+ last_time: Dernière fois
11
+ next_time: Prochaine fois
11
12
  no_next_time: Pas d'exécution prévue pour cette tâche
12
13
  disable: Désactiver
13
14
  enable: Activer
15
+ disable_all: Tout désactiver
16
+ enable_all: Tout activer
@@ -0,0 +1,16 @@
1
+ gd:
2
+ recurring_jobs: Obraichean ath-chùrsach
3
+ name: Ainm
4
+ description: Tuairisgeul
5
+ interval: Eadaramh
6
+ class: Clas
7
+ queue: Ciudha
8
+ arguments: Argamaidean
9
+ enqueue_now: Cuir sa chiudha an-dràsta
10
+ last_time: An t-àm mu dheireadh
11
+ next_time: An t-ath-àm
12
+ no_next_time: chan eil ath-ghnìomhachadh aig an obair seo
13
+ disable: Cuir à comas
14
+ enable: Cuir an comas
15
+ disable_all: Cuir na h-uile à comas
16
+ enable_all: Cuir na h-uile an comas
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: 5.0.2
4
+ version: 5.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Morton Jonuschat
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2023-02-27 00:00:00.000000000 Z
13
+ date: 2023-05-31 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: sidekiq
@@ -220,6 +220,7 @@ files:
220
220
  - web/locales/en.yml
221
221
  - web/locales/es.yml
222
222
  - web/locales/fr.yml
223
+ - web/locales/gd.yml
223
224
  - web/locales/it.yml
224
225
  - web/locales/ja.yml
225
226
  - web/locales/nl.yml