sidekiq-scheduler 5.0.4 → 5.0.6

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
  SHA256:
3
- metadata.gz: 17e9ebdeaa24ce323d7b3f94c7481d741e0f0f6d3daeded5eaef94f8b1e09f37
4
- data.tar.gz: c8e1d62c30406b7928444bdd05a0668aac6bbb47c1bc6a752ff795dbf67b8bb2
3
+ metadata.gz: a2d6cf0887d66e27d2ce10ec96eabcb2b89bd89c515af8e38d54b366b38a8df2
4
+ data.tar.gz: c0da1db9ad45afdaf3b6055ce22ccc24ac90a392f7a2b5787136bbdeb6456fd5
5
5
  SHA512:
6
- metadata.gz: f94c5008ef8a2ec39837adc8a25145b27c15abf2514ba22f9c2341b1306431aecfcceb877f8b07fe05c0daa09e26e6b4df3f6e10c118893fe78b11ca6b6751cb
7
- data.tar.gz: 61e7f37615f1c575d51c0e55593c4a82362829e21533182e60ec7a125fe76273e44bc055f6449a43185c083370eb1e416a0f1031671e537b6b85cec0ff3a218b
6
+ metadata.gz: 7d845a756d2ba958cfedadcf52f6ba6f19811eb5b88c94fc50989b6a6f2bf523dbc7d2f8eb8e44c9d0c20a483f5896e5c313e5428f2369368de12479a2472163
7
+ data.tar.gz: 797ebac76066faa408f2f43290f6aead6a4ff335cb966811efdeea5c70c7ca5a4f93e6bda15f864987294e505583999bff64d05f33f2f2b9d0c92f512487d905
data/CHANGELOG.md CHANGED
@@ -1,3 +1,11 @@
1
+ # 5.0.6
2
+ - [**FIX**] Fix typo in `config#to_hash` method [#479](https://github.com/sidekiq-scheduler/sidekiq-scheduler/pull/479)
3
+ - [**FIX**] Correctly clear scheduled jobs with Scheduler#clear_schedule! [#485](https://github.com/sidekiq-scheduler/sidekiq-scheduler/pull/485)
4
+ - [**FIX**] Fix scheduling of aperiodic cron jobs [#487](https://github.com/sidekiq-scheduler/sidekiq-scheduler/pull/487) (see [#484](https://github.com/sidekiq-scheduler/sidekiq-scheduler/pull/484) for more details as well)
5
+
6
+ # 5.0.5
7
+ - [**FIX**] Use correct folder structure for assets [#476](https://github.com/sidekiq-scheduler/sidekiq-scheduler/pull/476)
8
+
1
9
  # 5.0.4
2
10
  - [**FIX**] Ensure rufus-scheduler has a default rufus_scheduler_options value [#434](https://github.com/sidekiq-scheduler/sidekiq-scheduler/issues/426)
3
11
  - [**ENHANCEMENT**] Remove code related to sidekiq < 6 [#443](https://github.com/sidekiq-scheduler/sidekiq-scheduler/pull/443)
@@ -35,7 +43,7 @@
35
43
 
36
44
  # 5.0.0
37
45
 
38
- - [**FIX**] Ensure generated scheduled time has a precision of 3 miliseconds. [#418](https://github.com/sidekiq-scheduler/sidekiq-scheduler/pull/418)
46
+ - [**FIX**] Ensure generated scheduled time has a precision of 3 milliseconds. [#418](https://github.com/sidekiq-scheduler/sidekiq-scheduler/pull/418)
39
47
 
40
48
  *Note 1:* Check [# 5.0.0.beta1](#500beta1) & [# 5.0.0.beta2](#500beta2) releases for breaking changes.
41
49
 
@@ -88,6 +96,6 @@
88
96
  - [**ENHANCEMENT**] Highlight disabled jobs [#369](https://github.com/sidekiq-scheduler/sidekiq-scheduler/pull/369)
89
97
  - [**BREAKING CHANGE**] Require redis 4.2.0 [#370](https://github.com/sidekiq-scheduler/sidekiq-scheduler/pull/370)
90
98
  - [**FIX**] Fixes redis deprecation warning regarding `exists` [#370](https://github.com/sidekiq-scheduler/sidekiq-scheduler/pull/370)
91
- - [**BREAKING CHANGE**] Remove dependecy on thwait and e2mmap [#371](https://github.com/sidekiq-scheduler/sidekiq-scheduler/pull/371)
99
+ - [**BREAKING CHANGE**] Remove dependency on thwait and e2mmap [#371](https://github.com/sidekiq-scheduler/sidekiq-scheduler/pull/371)
92
100
  - Support Ruby 3.1 [#373](https://github.com/sidekiq-scheduler/sidekiq-scheduler/pull/373)
93
101
  - [**BREAKING CHANGE**] Set rufus_scheduler_options via sidekiq.yml file as configuration option [#375](https://github.com/sidekiq-scheduler/sidekiq-scheduler/pull/375)
data/README.md CHANGED
@@ -337,7 +337,7 @@ You can also override the thread pool size in Rufus Scheduler by setting the fol
337
337
  ## Notes about running on Multiple Hosts
338
338
 
339
339
  Under normal conditions, `cron` and `at` jobs are pushed once regardless of the number of `sidekiq-scheduler` running instances,
340
- assumming that time deltas between hosts is less than 24 hours.
340
+ assuming that time deltas between hosts is less than 24 hours.
341
341
 
342
342
  Non-normal conditions that could push a specific job multiple times are:
343
343
  - high cpu load + a high number of jobs scheduled at the same time, like 100 jobs
@@ -494,7 +494,7 @@ end
494
494
 
495
495
  ## The Spring preloader and Testing your initializer via Rails console
496
496
 
497
- 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.
497
+ 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 interfere with testing via the Rails console.
498
498
 
499
499
  **Spring will not reload initializers** unless the initializer is changed. Therefore, if you're making a change to your YML schedule file and reloading Rails console to see the change, Spring will make it seem like your modified schedule is not being reloaded.
500
500
 
@@ -539,7 +539,7 @@ MIT License
539
539
 
540
540
  ## Copyright
541
541
 
542
- - Copyright 2021 - 2023 Marcelo Lauxen.
542
+ - Copyright 2021 - 2024 Marcelo Lauxen.
543
543
  - Copyright 2013 - 2022 Moove-IT.
544
544
  - Copyright 2012 Morton Jonuschat.
545
545
  - Some parts copyright 2010 Ben VandenBos.
@@ -64,7 +64,7 @@ module SidekiqScheduler
64
64
  enabled: enabled?,
65
65
  dynamic: dynamic?,
66
66
  dynamic_every: dynamic_every?,
67
- shedule: schedule,
67
+ schedule: schedule,
68
68
  listened_queues_only: listened_queues_only?,
69
69
  rufus_scheduler_options: rufus_scheduler_options
70
70
  }
@@ -2,7 +2,7 @@ require 'sidekiq/web' unless defined?(Sidekiq::Web)
2
2
 
3
3
  if SidekiqScheduler::SidekiqAdapter::SIDEKIQ_GTE_7_3_0
4
4
 
5
- # Locale and asset cache is configured in `.regiester`
5
+ # Locale and asset cache is configured in `.register`
6
6
  Sidekiq::Web.register(SidekiqScheduler::Web,
7
7
  name: "recurring_jobs",
8
8
  tab: ["Recurring Jobs"],
@@ -20,7 +20,7 @@ else
20
20
  Sidekiq::Web.tabs['recurring_jobs'] = 'recurring-jobs'
21
21
  Sidekiq::Web.locales << File.expand_path("#{File.dirname(__FILE__)}/../../../web/locales")
22
22
 
23
- Sidekiq::Web.use Rack::Static, urls: ['/stylesheets-scheduler'],
23
+ Sidekiq::Web.use Rack::Static, urls: ['/recurring_jobs/stylesheets-scheduler'],
24
24
  root: ASSETS_PATH,
25
25
  cascade: true,
26
26
  header_rules: [[:all, { 'cache-control' => 'private, max-age=86400' }]]
@@ -121,7 +121,7 @@ module SidekiqScheduler
121
121
  Sidekiq.redis { |r| r.del(schedules_changed_key) unless r.type(schedules_changed_key) == 'zset' }
122
122
  end
123
123
 
124
- # Removes a queued job instance
124
+ # Registers a queued job instance
125
125
  #
126
126
  # @param [String] job_name The name of the job
127
127
  # @param [Time] time The time at which the job was cleared by the scheduler
@@ -65,7 +65,7 @@ module SidekiqScheduler
65
65
  end
66
66
  alias_method :schedule!, :reload_schedule!
67
67
 
68
- # Retrive the schedule configuration for the given name
68
+ # Retrieve the schedule configuration for the given name
69
69
  # if the name is nil it returns a hash with all the
70
70
  # names end their schedules.
71
71
  def get_schedule(name = nil)
@@ -17,7 +17,7 @@ module SidekiqScheduler
17
17
  # saying we will have to do it somehow still)
18
18
  #
19
19
  # NOTE: ^ Keeping this TODO here for now, in a future version of this project
20
- # we will remove those attr acessors and use only our config object. For now,
20
+ # we will remove those attr accessors and use only our config object. For now,
21
21
  # let's keep as it is.
22
22
 
23
23
  # Set to enable or disable the scheduler.
@@ -196,7 +196,7 @@ module SidekiqScheduler
196
196
  @rufus_scheduler = nil
197
197
  end
198
198
 
199
- @@scheduled_jobs = {}
199
+ @scheduled_jobs = {}
200
200
 
201
201
  rufus_scheduler
202
202
  end
@@ -268,9 +268,9 @@ module SidekiqScheduler
268
268
  conf = SidekiqScheduler::Utils.sanitize_job_config(config)
269
269
 
270
270
  if job.is_a?(Rufus::Scheduler::CronJob)
271
- idempotent_job_enqueue(name, SidekiqScheduler::Utils.calc_cron_run_time(job.cron_line, time.utc), conf)
271
+ idempotent_job_enqueue(name, SidekiqScheduler::Utils.calc_cron_run_time(job.cron_line, time.to_t), conf)
272
272
  else
273
- idempotent_job_enqueue(name, time, conf)
273
+ idempotent_job_enqueue(name, time.to_t, conf)
274
274
  end
275
275
  end
276
276
  end
@@ -303,12 +303,12 @@ module SidekiqScheduler
303
303
  end
304
304
 
305
305
  # Adds a Hash with schedule metadata as the last argument to call the worker.
306
- # It currently returns the schedule time as a Float number representing the milisencods
306
+ # It currently returns the schedule time as a Float number representing the milliseconds
307
307
  # since epoch.
308
308
  #
309
309
  # @example with hash argument
310
310
  # arguments_with_metadata({value: 1}, scheduled_at: Time.now.round(3))
311
- # #=> [{value: 1}, {scheduled_at: <miliseconds since epoch>}]
311
+ # #=> [{value: 1}, {scheduled_at: <milliseconds since epoch>}]
312
312
  #
313
313
  # @param args [Array|Hash]
314
314
  # @param metadata [Hash]
@@ -73,7 +73,7 @@ module SidekiqScheduler
73
73
  # Returns true if the enqueuing needs to be done for an ActiveJob
74
74
  # class false otherwise.
75
75
  #
76
- # @param [Class] klass the class to check is decendant from ActiveJob
76
+ # @param [Class] klass the class to check is descendant from ActiveJob
77
77
  #
78
78
  # @return [Boolean]
79
79
  def self.active_job_enqueue?(klass)
@@ -155,9 +155,11 @@ module SidekiqScheduler
155
155
  #
156
156
  # @return [Time]
157
157
  def self.calc_cron_run_time(cron, time)
158
- time = time.round # remove sub seconds to prevent rounding errors.
159
- next_t = cron.next_time(time).utc
160
- previous_t = cron.previous_time(time).utc
158
+ time = time.floor # remove sub seconds to prevent rounding errors.
159
+ return time if cron.match?(time) # If the time is a perfect match then return it.
160
+
161
+ next_t = cron.next_time(time).to_t
162
+ previous_t = cron.previous_time(time).to_t
161
163
  # The `time` var is some point between `previous_t` and `next_t`.
162
164
  # Figure out how far off we are from each side in seconds.
163
165
  next_diff = next_t - time
@@ -1,3 +1,3 @@
1
1
  module SidekiqScheduler
2
- VERSION = "5.0.4"
2
+ VERSION = "5.0.6"
3
3
  end
@@ -1,7 +1,7 @@
1
1
  <% if SidekiqScheduler::SidekiqAdapter::SIDEKIQ_GTE_7_3_0 %>
2
- <%= style_tag "stylesheets-scheduler/recurring_jobs.css" %>
2
+ <%= style_tag "recurring_jobs/stylesheets-scheduler/recurring_jobs.css" %>
3
3
  <% else %>
4
- <link href="<%= root_path %>stylesheets-scheduler/recurring_jobs.css" media="screen" rel="stylesheet" type="text/css" />
4
+ <link href="<%= root_path %>recurring_jobs/stylesheets-scheduler/recurring_jobs.css" media="screen" rel="stylesheet" type="text/css" />
5
5
  <% end %>
6
6
 
7
7
  <div class="row">
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.4
4
+ version: 5.0.6
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: 2024-07-04 00:00:00.000000000 Z
13
+ date: 2024-08-01 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: sidekiq
@@ -220,7 +220,7 @@ files:
220
220
  - lib/sidekiq-scheduler/version.rb
221
221
  - lib/sidekiq-scheduler/web.rb
222
222
  - lib/sidekiq/scheduler.rb
223
- - web/assets/stylesheets-scheduler/recurring_jobs.css
223
+ - web/assets/recurring_jobs/stylesheets-scheduler/recurring_jobs.css
224
224
  - web/locales/cs.yml
225
225
  - web/locales/de.yml
226
226
  - web/locales/en.yml
@@ -239,7 +239,8 @@ files:
239
239
  homepage: https://sidekiq-scheduler.github.io/sidekiq-scheduler/
240
240
  licenses:
241
241
  - MIT
242
- metadata: {}
242
+ metadata:
243
+ rubygems_mfa_required: 'true'
243
244
  post_install_message:
244
245
  rdoc_options: []
245
246
  require_paths: