dynamodb-sidekiq-scheduler 0.5 → 0.6

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: edfdd3c98244e64bedb7799d4ef3c26f4b155cb9941b3506566364ff28ccd819
4
- data.tar.gz: b8c5723d85a3ae4b53cc6e64768cf7c54ead6463734d9f0ea26b9bcb6e7af4a9
3
+ metadata.gz: 20ac92a2fa35e6f1e15f3307bbdd862aef92ecaafb1d16760ca9061dbbce334a
4
+ data.tar.gz: 94599cadc83d8afb968649150964f51e4dc846f74a2de81a9570906cb4facc03
5
5
  SHA512:
6
- metadata.gz: 2a86e0424c481068e135dd48fe6b51ece4d331c0f7649d6f1faf087a03d671598675525bc16c909e456adda54cd164d51b5f6569ab52ee474b7a840709d19e7a
7
- data.tar.gz: 3d7df3c11fce1677a47260272da36f02ca89518818bc54e8cbfe19ea473b1a753b2d857f9a5d50ac9c435f59b4a6a688771b110b680803e650fef04ccc2fd39f
6
+ metadata.gz: 540ff094b04ca414461214101b441f40d86ded4d1a3304c3ac5a678596adf3fd52455a63a013d81f099a578f13207f2be4bf2233c7a676af72ae69a8f40ed7c5
7
+ data.tar.gz: 5a327f337bbc1ce073a8b8a9cdc4a8b5910cb02e67d39701b61f5e855b7fff729f24a2805028c19bbe14490ffcd995799f25645b1fa0a14e4096bc9216c21a9f
data/CHANGELOG.md CHANGED
@@ -1,3 +1,24 @@
1
+ # 6.0.2
2
+ - [**FIX**] Use parser-safe web locale keys for the recurring jobs tab so the Sidekiq Web UI works with Sidekiq 8.1.3+ [#514](https://github.com/sidekiq-scheduler/sidekiq-scheduler/issues/514)
3
+ - [**FIX**] Stop symbolizing scheduled job `args` hash keys so string keys from YAML/JSON are preserved when enqueuing [ca3d405](https://github.com/sidekiq-scheduler/sidekiq-scheduler/commit/ca3d405e62433e3d889ebba1e3dedd3b0de0c8ef)
4
+
5
+ # 6.0.1
6
+ - [**FIX**] Fix issue with Sidekiq v7.3.0-v7.3.6 [#503](https://github.com/sidekiq-scheduler/sidekiq-scheduler/pull/503)
7
+
8
+ # 6.0.0
9
+ - Check the changelog for beta1 and beta2 of this version.
10
+
11
+ # 6.0.0.beta2
12
+ - [**FIX**/**BREAKING CHANGE**] Don't clear "schedule" key on boot in `dynamic` schedule mode [#467](https://github.com/sidekiq-scheduler/sidekiq-scheduler/pull/467)
13
+ - If you use sidekiq-scheduler with the `dynamic` mode, be aware that the schedule key won't be cleared on boot anymore (so maybe patches handling that in your codebase might have to be removed)
14
+ - [**FIX**] SidekiqScheduler::Manager enormous inspect output [17f9c7f](https://github.com/sidekiq-scheduler/sidekiq-scheduler/commit/17f9c7ffc7f7db79a1cb047bed985f2bdf12ac92) / [#462](https://github.com/sidekiq-scheduler/sidekiq-scheduler/issues/462).
15
+ - [**FIX/ENHANCEMENT**] Remove checks that would raise an error if any of the following options was not under the `scheduler` key (`enabled`, `dynamic`, `dynamic_every`, `schedule`, `listened_queues_only`, `rufus_scheduler_options`). [1e64958](https://github.com/sidekiq-scheduler/sidekiq-scheduler/commit/1e6495838aaee91cbf53fbd57c3749f0ed35dc28) / [#469](https://github.com/sidekiq-scheduler/sidekiq-scheduler/issues/469)
16
+ - This was needed for those migrating from v4 to v5, but isn't anymore.
17
+
18
+ # 6.0.0.beta1
19
+ - [**ENHANCEMENT**] Adds compatibility with Sidekiq 8 [#497](https://github.com/sidekiq-scheduler/sidekiq-scheduler/pull/497)
20
+ - [**BREAKING CHANGE**] Drop support for Sidekiq 7.2 and earlier [#497](https://github.com/sidekiq-scheduler/sidekiq-scheduler/pull/498)
21
+
1
22
  # 5.0.6
2
23
  - [**FIX**] Fix typo in `config#to_hash` method [#479](https://github.com/sidekiq-scheduler/sidekiq-scheduler/pull/479)
3
24
  - [**FIX**] Correctly clear scheduled jobs with Scheduler#clear_schedule! [#485](https://github.com/sidekiq-scheduler/sidekiq-scheduler/pull/485)
@@ -18,7 +39,7 @@
18
39
  - [**FIX**] Prevent stack level too deep error by implementing `to_hash` method [#470](https://github.com/sidekiq-scheduler/sidekiq-scheduler/pull/470)
19
40
  - [**ENHANCEMENT**] Support new Sidekiq model for registering UI plugins [#472](https://github.com/sidekiq-scheduler/sidekiq-scheduler/pull/472)
20
41
  - [**ENHANCEMENT**] Stop testing against Ruby 2.7 and 3.0 [#472](https://github.com/sidekiq-scheduler/sidekiq-scheduler/pull/472#discussion_r1663197863)
21
- - [**ENHANCEMENT**] Display `at` and `in` in the dashboard [#291](https://github.com/sidekiq-scheduler/sidekiq-scheduler/pull/291)
42
+ - [**ENHANCEMENT**] Display `at` and `in` in the dashboard [#291](https://github.com/sidekiq-scheduler/sidekiq-scheduler/pull/291)
22
43
  - [**ENHANCEMENT**] Docs enhancements [#442](https://github.com/sidekiq-scheduler/sidekiq-scheduler/pull/442), [#449](https://github.com/sidekiq-scheduler/sidekiq-scheduler/pull/449), [#457](https://github.com/sidekiq-scheduler/sidekiq-scheduler/pull/457), [#465](https://github.com/sidekiq-scheduler/sidekiq-scheduler/pull/465), [58e1835](https://github.com/sidekiq-scheduler/sidekiq-scheduler/commit/58e18351054fc3c264b2b5a684173316f674c386)
23
44
 
24
45
 
@@ -40,7 +61,7 @@
40
61
  - [**ENHANCEMENT**] Adds Ruby 3.2 to the CI matrix. [#420](https://github.com/sidekiq-scheduler/sidekiq-scheduler/pull/420)
41
62
  - [**DOCS**] README: refer to v5 as released. [#421](https://github.com/sidekiq-scheduler/sidekiq-scheduler/pull/421)
42
63
  - [**FIX**] Fix dependency on Rails `.present?` method. [#425](https://github.com/sidekiq-scheduler/sidekiq-scheduler/pull/425)
43
-
64
+
44
65
  # 5.0.0
45
66
 
46
67
  - [**FIX**] Ensure generated scheduled time has a precision of 3 milliseconds. [#418](https://github.com/sidekiq-scheduler/sidekiq-scheduler/pull/418)
@@ -59,7 +80,7 @@
59
80
  - [**BREAKING CHANGE**] Moves all sidekiq-scheduler config options under the `scheduler` key in the `sidekiq.yml` file [#412](https://github.com/sidekiq-scheduler/sidekiq-scheduler/pull/412)
60
81
  - If you're migrating from v4 to v5, any `sidekiq-scheduler` config you may have in your `sidekiq.yml` should be moved under the `scheduler` key.
61
82
  - See [#412](https://github.com/sidekiq-scheduler/sidekiq-scheduler/pull/412) to see which are the config options that you need to move under the `scheduler` key.
62
-
83
+
63
84
  - [**BREAKING CHANGE**] Drop support for EOL Ruby & Sidekiq versions (Ruby: `2.5.x` & `2.6.x`; Sidekiq: `4.x` & `5.x`) [#411](https://github.com/sidekiq-scheduler/sidekiq-scheduler/pull/411)
64
85
 
65
86
  - [**FIX**] Add support for Sidekiq 7 [#410](https://github.com/sidekiq-scheduler/sidekiq-scheduler/pull/410)
@@ -98,4 +119,4 @@
98
119
  - [**FIX**] Fixes redis deprecation warning regarding `exists` [#370](https://github.com/sidekiq-scheduler/sidekiq-scheduler/pull/370)
99
120
  - [**BREAKING CHANGE**] Remove dependency on thwait and e2mmap [#371](https://github.com/sidekiq-scheduler/sidekiq-scheduler/pull/371)
100
121
  - Support Ruby 3.1 [#373](https://github.com/sidekiq-scheduler/sidekiq-scheduler/pull/373)
101
- - [**BREAKING CHANGE**] Set rufus_scheduler_options via sidekiq.yml file as configuration option [#375](https://github.com/sidekiq-scheduler/sidekiq-scheduler/pull/375)
122
+ - [**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
@@ -18,7 +18,7 @@
18
18
  `sidekiq-scheduler` is an extension to [Sidekiq](http://github.com/mperham/sidekiq) that
19
19
  pushes jobs in a scheduled way, mimicking cron utility.
20
20
 
21
- __Note:__ Current branch contains work of the v5 release, if you are looking for version 2.2.\*, 3.\*, or 4.\*, go to [2.2-stable branch](https://github.com/sidekiq-scheduler/sidekiq-scheduler/tree/2.2-stable) / [v3-stable](https://github.com/sidekiq-scheduler/sidekiq-scheduler/tree/v3-stable) / [v4-stable](https://github.com/sidekiq-scheduler/sidekiq-scheduler/tree/v4-stable).
21
+ __Note:__ Current branch contains work of the v6 release, if you are looking for version 2.2.\*, 3.\*, 4.\*, or 5.\*, go to [2.2-stable branch](https://github.com/sidekiq-scheduler/sidekiq-scheduler/tree/2.2-stable) / [v3-stable](https://github.com/sidekiq-scheduler/sidekiq-scheduler/tree/v3-stable) / [v4-stable](https://github.com/sidekiq-scheduler/sidekiq-scheduler/tree/v4-stable) / [v5-stable](https://github.com/sidekiq-scheduler/sidekiq-scheduler/tree/v5-stable).
22
22
 
23
23
  ## Installation
24
24
 
@@ -58,7 +58,7 @@ __Note:__ In Sidekiq v6.3 `Sidekiq::Job` was introduced as an alias for `Sidekiq
58
58
  ```
59
59
 
60
60
  > [!NOTE]
61
- > sidekiq-scheduler uses [fugit](https://github.com/floraison/fugit) under the hood, which supports up to six arguments as the cron string, [see](https://github.com/floraison/fugit?tab=readme-ov-file#the-second-extension).
61
+ > sidekiq-scheduler uses [fugit](https://github.com/floraison/fugit) under the hood, which supports up to six arguments as the cron string, [see](https://github.com/floraison/fugit?tab=readme-ov-file#the-second-extension).
62
62
 
63
63
  Run sidekiq:
64
64
 
@@ -125,16 +125,16 @@ The schedule is configured through the `:scheduler:` -> `:schedule` config entry
125
125
  # Enable / disable a job. All jobs are enabled by default.
126
126
  enabled: true
127
127
 
128
- # Deconstructs a hash defined as the `args` to keyword arguments.
128
+ # Deconstructs a hash defined as the `args` to keyword arguments.
129
129
  #
130
130
  # `false` by default.
131
- #
131
+ #
132
132
  # Example
133
- #
133
+ #
134
134
  # my_job:
135
135
  # cron: '0 0 * * * *'
136
136
  # class: MyJob
137
- # args: { foo: 'bar', hello: 'world' }
137
+ # args: { foo: 'bar', hello: 'world' }
138
138
  # keyword_argument: true
139
139
  #
140
140
  # class MyJob < ActiveJob::Base
@@ -142,7 +142,7 @@ The schedule is configured through the `:scheduler:` -> `:schedule` config entry
142
142
  # # ...
143
143
  # end
144
144
  # end
145
- keyword_argument: true
145
+ keyword_argument: true
146
146
  ```
147
147
 
148
148
  ### Schedule metadata
@@ -347,7 +347,7 @@ Non-normal conditions that could push a specific job multiple times are:
347
347
 
348
348
  ### Suggested setup for Multiple Hosts using Heroku and Rails
349
349
 
350
- Configuration options `every`, `interval` and `in` will push once per host. This may be undesirable. One way to achieve single jobs per the schedule would be to manually designate a host as the scheduler. The goal is to have a single scheduler process running across all your hosts.
350
+ Configuration options `every`, `interval` and `in` will push once per host. This may be undesirable. One way to achieve single jobs per the schedule would be to manually designate a host as the scheduler. The goal is to have a single scheduler process running across all your hosts.
351
351
 
352
352
  This can be achieved by using an environment variable and controlling the number of dynos. In Rails, you can read this variable during initialization and then conditionally load your config file.
353
353
 
@@ -384,7 +384,7 @@ worker: bundle exec sidekiq -q default
384
384
  scheduler: IS_SCHEDULER=true bundle exec sidekiq -q default
385
385
  ```
386
386
 
387
- When running via Heroku, you set your `scheduler` process to have 1 dyno. This will ensure you have at most 1 worker loading the schedule.
387
+ When running via Heroku, you set your `scheduler` process to have 1 dyno. This will ensure you have at most 1 worker loading the schedule.
388
388
 
389
389
  ## Notes on when Sidekiq worker is down
390
390
 
@@ -397,7 +397,7 @@ Possible solutions include:
397
397
  - Zero downtime deploy for sidekiq workers: keep at least one worker up during whole deploy and only restart/shut it down after when new one has started
398
398
  - Running scheduler inside your unicorn/rails processes (if you already have zero downtime deploy set up for these)
399
399
 
400
- Each option has it's own pros and cons.
400
+ Each option has it's own pros and cons.
401
401
 
402
402
  ## Notes when running multiple Sidekiq processors on the same Redis
403
403
 
@@ -480,6 +480,8 @@ run Sidekiq::Web
480
480
 
481
481
  ![Sidekiq Web Integration](https://github.com/sidekiq-scheduler/sidekiq-scheduler/raw/master/images/recurring-jobs-ui-tab.png)
482
482
 
483
+ ![Sidekiq Web Integration Dark Mode](https://github.com/sidekiq-scheduler/sidekiq-scheduler/raw/master/images/recurring-jobs-ui-tab-dark.png)
484
+
483
485
  ## ActiveJob integration
484
486
 
485
487
  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.
@@ -1,27 +1,22 @@
1
1
  require 'sidekiq/web' unless defined?(Sidekiq::Web)
2
2
 
3
- if SidekiqScheduler::SidekiqAdapter::SIDEKIQ_GTE_7_3_0
3
+ # Locale and asset cache is configured in `cfg.register`
4
+ args = {
5
+ name: "recurring_jobs",
6
+ tab: ["recurring_jobs"],
7
+ index: ["recurring-jobs"],
8
+ root_dir: File.expand_path("../../../web", File.dirname(__FILE__)),
9
+ asset_paths: ["stylesheets-scheduler"]
10
+ }
4
11
 
5
- # Locale and asset cache is configured in `.register`
6
- Sidekiq::Web.register(SidekiqScheduler::Web,
7
- name: "recurring_jobs",
8
- tab: ["Recurring Jobs"],
9
- index: ["recurring-jobs"],
10
- root_dir: File.expand_path("../../../web", File.dirname(__FILE__)),
11
- asset_paths: ["stylesheets-scheduler"]) do |app|
12
- # add middleware or additional settings here
12
+ if SidekiqScheduler::SidekiqAdapter::SIDEKIQ_GTE_8_0_0
13
+ Sidekiq::Web.configure do |cfg|
14
+ cfg.register(SidekiqScheduler::Web, **args) do |app|
15
+ # add middleware or additional settings here
16
+ end
13
17
  end
14
-
15
18
  else
16
-
17
- ASSETS_PATH = File.expand_path('../../../web/assets', __dir__)
18
-
19
- Sidekiq::Web.register(SidekiqScheduler::Web)
20
- Sidekiq::Web.tabs['recurring_jobs'] = 'recurring-jobs'
21
- Sidekiq::Web.locales << File.expand_path("#{File.dirname(__FILE__)}/../../../web/locales")
22
-
23
- Sidekiq::Web.use Rack::Static, urls: ['/recurring_jobs/stylesheets-scheduler'],
24
- root: ASSETS_PATH,
25
- cascade: true,
26
- header_rules: [[:all, { 'cache-control' => 'private, max-age=86400' }]]
19
+ Sidekiq::Web.register(SidekiqScheduler::Web, **args) do |app|
20
+ # add middleware or additional settings here
21
+ end
27
22
  end
@@ -13,7 +13,7 @@ module SidekiqScheduler
13
13
 
14
14
  @scheduler_instance = SidekiqScheduler::Scheduler.new(config)
15
15
  SidekiqScheduler::Scheduler.instance = @scheduler_instance
16
- Sidekiq.schedule = config.schedule if @scheduler_instance.enabled
16
+ Sidekiq.schedule = config.schedule if @scheduler_instance.enabled && !@scheduler_instance.dynamic
17
17
  end
18
18
 
19
19
  def stop
@@ -256,6 +256,10 @@ module SidekiqScheduler
256
256
  }
257
257
  end
258
258
 
259
+ def inspect
260
+ "#<SidekiqScheduler::Scheduler enabled=#{enabled} dynamic=#{dynamic} dynamic_every=#{dynamic_every} listened_queues_only=#{listened_queues_only} rufus_scheduler_options=#{rufus_scheduler_options}>"
261
+ end
262
+
259
263
  private
260
264
 
261
265
  attr_reader :scheduler_config
@@ -344,11 +348,7 @@ module SidekiqScheduler
344
348
  def prepare_arguments(config)
345
349
  config['class'] = SidekiqScheduler::Utils.try_to_constantize(config['class'])
346
350
 
347
- if config['args'].is_a?(Hash)
348
- config['args'].symbolize_keys! if config['args'].respond_to?(:symbolize_keys!)
349
- else
350
- config['args'] = Array(config['args'])
351
- end
351
+ config['args'] = Array(config['args']) unless config['args'].is_a?(Hash)
352
352
 
353
353
  config
354
354
  end
@@ -1,90 +1,40 @@
1
1
  module SidekiqScheduler
2
- class OptionNotSupportedAnymore < StandardError; end
3
-
4
2
  class SidekiqAdapter
5
- SIDEKIQ_GTE_6_5_0 = Gem::Version.new(Sidekiq::VERSION) >= Gem::Version.new('6.5.0')
6
- SIDEKIQ_GTE_7_0_0 = Gem::Version.new(Sidekiq::VERSION) >= Gem::Version.new('7.0.0')
7
3
  SIDEKIQ_GTE_7_3_0 = Gem::Version.new(Sidekiq::VERSION) >= Gem::Version.new('7.3.0')
4
+ SIDEKIQ_GTE_8_0_0 = Gem::Version.new(Sidekiq::VERSION) >= Gem::Version.new('8.0.0')
8
5
 
9
6
  def self.fetch_scheduler_config_from_sidekiq(sidekiq_config)
10
7
  return {} if sidekiq_config.nil?
11
8
 
12
- check_using_old_sidekiq_scheduler_config!(sidekiq_config)
13
-
14
- if SIDEKIQ_GTE_6_5_0
15
- sidekiq_config.fetch(:scheduler, {})
16
- else
17
- sidekiq_config.options.fetch(:scheduler, {})
18
- end
19
- end
20
-
21
- def self.check_using_old_sidekiq_scheduler_config!(sidekiq_config)
22
- %i[enabled dynamic dynamic_every schedule listened_queues_only rufus_scheduler_options].each do |option|
23
- if SIDEKIQ_GTE_7_0_0
24
- if sidekiq_config.key?(option)
25
- raise OptionNotSupportedAnymore, ":#{option} option should be under the :scheduler: key"
26
- end
27
- elsif SIDEKIQ_GTE_6_5_0
28
- unless sidekiq_config[option].nil?
29
- raise OptionNotSupportedAnymore, ":#{option} option should be under the :scheduler: key"
30
- end
31
- else
32
- if sidekiq_config.options.key?(option)
33
- raise OptionNotSupportedAnymore, ":#{option} option should be under the :scheduler: key"
34
- end
35
- end
36
- end
9
+ sidekiq_config.fetch(:scheduler, {})
37
10
  end
38
11
 
39
12
  def self.start_schedule_manager(sidekiq_config:, schedule_manager:)
40
- if SIDEKIQ_GTE_6_5_0
41
- sidekiq_config[:schedule_manager] = schedule_manager
42
- sidekiq_config[:schedule_manager].start
43
- else
44
- sidekiq_config.options[:schedule_manager] = schedule_manager
45
- sidekiq_config.options[:schedule_manager].start
46
- end
13
+ sidekiq_config[:schedule_manager] = schedule_manager
14
+ sidekiq_config[:schedule_manager].start
47
15
  end
48
16
 
49
17
  def self.stop_schedule_manager(sidekiq_config:)
50
- if SIDEKIQ_GTE_6_5_0
51
- sidekiq_config[:schedule_manager].stop
52
- else
53
- sidekiq_config.options[:schedule_manager].stop
54
- end
18
+ sidekiq_config[:schedule_manager].stop
55
19
  end
56
20
 
57
21
  def self.sidekiq_queues(sidekiq_config)
58
- if SIDEKIQ_GTE_7_0_0
59
- if sidekiq_config.nil? || (sidekiq_config.respond_to?(:empty?) && sidekiq_config.empty?)
60
- Sidekiq.instance_variable_get(:@config).queues.map(&:to_s)
61
- else
62
- sidekiq_config.queues.map(&:to_s)
63
- end
64
- elsif SIDEKIQ_GTE_6_5_0
65
- Sidekiq[:queues].map(&:to_s)
22
+ if sidekiq_config.nil? || (sidekiq_config.respond_to?(:empty?) && sidekiq_config.empty?)
23
+ Sidekiq.instance_variable_get(:@config).queues.map(&:to_s)
66
24
  else
67
- Sidekiq.options[:queues].map(&:to_s)
25
+ sidekiq_config.queues.map(&:to_s)
68
26
  end
69
27
  end
70
28
 
71
29
  def self.redis_key_exists?(key_name)
72
30
  Sidekiq.redis do |r|
73
- if SIDEKIQ_GTE_7_0_0
74
- r.exists(key_name) > 0
75
- else
76
- r.exists?(key_name)
77
- end
31
+ r.exists(key_name) > 0
78
32
  end
79
33
  end
80
34
 
81
35
  def self.redis_zrangebyscore(key, from, to)
82
36
  Sidekiq.redis do |r|
83
- if SIDEKIQ_GTE_7_0_0
84
- r.zrange(key, from, to, "BYSCORE")
85
- else
86
- r.zrangebyscore(key, from, to)
87
- end
37
+ r.zrange(key, from, to, "BYSCORE")
88
38
  end
89
39
  end
90
40
  end
@@ -1,3 +1,3 @@
1
1
  module SidekiqScheduler
2
- VERSION = "0.5"
2
+ VERSION = "0.6"
3
3
  end
@@ -6,9 +6,29 @@ module SidekiqScheduler
6
6
  # Hook into *Sidekiq::Web* app which adds a new '/recurring-jobs' page
7
7
 
8
8
  module Web
9
- VIEW_PATH = File.expand_path('../../../web/views', __FILE__)
9
+ VIEW_PATH = File.expand_path(SidekiqAdapter::SIDEKIQ_GTE_8_0_0 ? '../../../web/views' : '../../../web/views/sidekiq73', __FILE__)
10
+
11
+ module Helpers
12
+ def sidekiq_scheduler_fetch_route_param(key)
13
+ if SidekiqAdapter::SIDEKIQ_GTE_8_0_0
14
+ route_params(key)
15
+ else
16
+ route_params[key]
17
+ end
18
+ end
19
+
20
+ def sidekiq_scheduler_fetch_url_param(key)
21
+ if SidekiqAdapter::SIDEKIQ_GTE_8_0_0
22
+ url_params(key)
23
+ else
24
+ params[key]
25
+ end
26
+ end
27
+ end
10
28
 
11
29
  def self.registered(app)
30
+ app.helpers(Helpers)
31
+
12
32
  app.get '/recurring-jobs' do
13
33
  @presented_jobs = JobPresenter.build_collection(Sidekiq.schedule!)
14
34
 
@@ -16,7 +36,7 @@ module SidekiqScheduler
16
36
  end
17
37
 
18
38
  app.post '/recurring-jobs/:name/enqueue' do
19
- schedule = Sidekiq.get_schedule(params[:name])
39
+ schedule = Sidekiq.get_schedule(sidekiq_scheduler_fetch_route_param(:name))
20
40
  SidekiqScheduler::Scheduler.instance.enqueue_job(schedule)
21
41
  redirect "#{root_path}recurring-jobs"
22
42
  end
@@ -24,7 +44,7 @@ module SidekiqScheduler
24
44
  app.post '/recurring-jobs/:name/toggle' do
25
45
  Sidekiq.reload_schedule!
26
46
 
27
- SidekiqScheduler::Scheduler.instance.toggle_job_enabled(params[:name])
47
+ SidekiqScheduler::Scheduler.instance.toggle_job_enabled(sidekiq_scheduler_fetch_route_param(:name))
28
48
  redirect "#{root_path}recurring-jobs"
29
49
  end
30
50
 
@@ -36,7 +56,7 @@ module SidekiqScheduler
36
56
  end
37
57
 
38
58
  app.post '/recurring-jobs/toggle-all' do
39
- SidekiqScheduler::Scheduler.instance.toggle_all_jobs(params[:action] == 'enable')
59
+ SidekiqScheduler::Scheduler.instance.toggle_all_jobs(sidekiq_scheduler_fetch_url_param(:action) == 'enable')
40
60
  redirect "#{root_path}recurring-jobs"
41
61
  end
42
62
 
@@ -1,45 +1,81 @@
1
- .recurring-jobs { border-top-left-radius: 4px; border-top-right-radius: 4px; }
2
- .recurring-jobs .title { margin-bottom: 5px; }
3
- .recurring-jobs .title .name { font-weight: bold;}
4
- .recurring-jobs .info,
5
- .recurring-jobs .description { margin-bottom: 5px; }
6
- .recurring-jobs .actions { margin-bottom: 5px; }
7
- .recurring-jobs .status,
8
- .recurring-jobs .description { font-size: 12px; }
9
- .recurring-jobs .enqueue { margin-bottom: 0.5rem }
10
-
11
- .list-group-item {
12
- background-color: #f3f3f3;
13
- color: #585454;
14
- border: 1px solid rgba(0, 0, 0, 0.1);
1
+ .sidekiq-scheduler .job-name {
2
+ color: var(--color-primary);
3
+ display: block;
4
+ font-size: var(--font-size);
5
+ font-weight: 700;
6
+ }
7
+
8
+ .sidekiq-scheduler .queue {
9
+ text-align: right;
15
10
  }
16
11
 
17
- .list-group-item-disabled {
12
+ .sidekiq-scheduler .btn-xs {
13
+ padding: 1px 5px;
14
+ font-size: var(--font-size-small);
15
+ line-height: 1.5;
16
+ }
17
+
18
+ .sidekiq-scheduler .description,
19
+ .sidekiq-scheduler .last-time,
20
+ .sidekiq-scheduler .next-time {
21
+ font-size: var(--font-size-small);
22
+ }
23
+
24
+ .sidekiq-scheduler .description {
25
+ padding-top: 10px;
26
+ }
27
+
28
+ .sidekiq-scheduler .inline {
29
+ display: inline;
30
+ }
31
+
32
+ .sidekiq-scheduler .job-list .job {
33
+ background-color: var(--color-elevated);
34
+ border: 1px solid var(--color-border);
35
+ box-shadow: 0 2px 4px 0 var(--color-shadow);
36
+ padding: 10px;
37
+ }
38
+
39
+ .sidekiq-scheduler .column-2 {
40
+ float: left;
41
+ width: 50%;
42
+ }
43
+
44
+ .sidekiq-scheduler .column-3 {
45
+ float: left;
46
+ width: 33.33%;
47
+ }
48
+
49
+ .sidekiq-scheduler .row:after {
50
+ content: "";
51
+ display: table;
52
+ clear: both;
53
+ }
54
+
55
+ .sidekiq-scheduler .job.disabled-job {
18
56
  background-color: #f3d3d3;
57
+ color: #585454;
19
58
  }
20
59
 
21
60
  @media (prefers-color-scheme: dark) {
22
- .list-group-item {
23
- background-color: #222;
24
- color: white;
25
- border: 1px solid #555;
26
- }
27
- .list-group-item-disabled {
28
- color: #585454;
61
+ .sidekiq-scheduler .job.disabled-job {
62
+ background-color: #4f0b0b;
29
63
  }
30
64
  }
31
65
 
32
- .toggle-all-buttons {
33
- margin-top: 20px;
34
- margin-bottom: 10px;
35
- line-height: 45px;
36
- text-align: right;
66
+ .sidekiq-scheduler .disabled-job .next-time {
67
+ text-decoration: line-through;
37
68
  }
38
69
 
39
- @media (max-width: 768px) {
40
- .toggle-all-buttons {
41
- margin-top: 0;
70
+ @media screen and (max-width: 1000px) {
71
+ .sidekiq-scheduler .column-2,
72
+ .sidekiq-scheduler .column-3,
73
+ .sidekiq-scheduler .description {
74
+ width: 100%;
75
+ padding: 5px 10px;
76
+ }
77
+
78
+ .sidekiq-scheduler .queue {
42
79
  text-align: left;
43
- line-height: inherit;
44
80
  }
45
81
  }
@@ -0,0 +1,45 @@
1
+ .recurring-jobs { border-top-left-radius: 4px; border-top-right-radius: 4px; }
2
+ .recurring-jobs .title { margin-bottom: 5px; }
3
+ .recurring-jobs .title .name { font-weight: bold;}
4
+ .recurring-jobs .info,
5
+ .recurring-jobs .description { margin-bottom: 5px; }
6
+ .recurring-jobs .actions { margin-bottom: 5px; }
7
+ .recurring-jobs .status,
8
+ .recurring-jobs .description { font-size: 12px; }
9
+ .recurring-jobs .enqueue { margin-bottom: 0.5rem }
10
+
11
+ .list-group-item {
12
+ background-color: #f3f3f3;
13
+ color: #585454;
14
+ border: 1px solid rgba(0, 0, 0, 0.1);
15
+ }
16
+
17
+ .list-group-item-disabled {
18
+ background-color: #f3d3d3;
19
+ }
20
+
21
+ @media (prefers-color-scheme: dark) {
22
+ .list-group-item {
23
+ background-color: #222;
24
+ color: white;
25
+ border: 1px solid #555;
26
+ }
27
+ .list-group-item-disabled {
28
+ color: #585454;
29
+ }
30
+ }
31
+
32
+ .toggle-all-buttons {
33
+ margin-top: 20px;
34
+ margin-bottom: 10px;
35
+ line-height: 45px;
36
+ text-align: right;
37
+ }
38
+
39
+ @media (max-width: 768px) {
40
+ .toggle-all-buttons {
41
+ margin-top: 0;
42
+ text-align: left;
43
+ line-height: inherit;
44
+ }
45
+ }
data/web/locales/cs.yml CHANGED
@@ -1,5 +1,4 @@
1
1
  cs:
2
- "Recurring Jobs": Pravidelně opakované
3
2
  recurring_jobs: Pravidelně opakované
4
3
  name: Jméno
5
4
  description: Popis
data/web/locales/de.yml CHANGED
@@ -1,5 +1,4 @@
1
1
  de:
2
- "Recurring Jobs": Wiederkehrende Jobs
3
2
  recurring_jobs: Wiederkehrende Jobs
4
3
  name: Name
5
4
  description: Beschreibung
data/web/locales/en.yml CHANGED
@@ -1,5 +1,4 @@
1
1
  en:
2
- "Recurring Jobs": Recurring Jobs
3
2
  recurring_jobs: Recurring Jobs
4
3
  name: Name
5
4
  description: Description
data/web/locales/es.yml CHANGED
@@ -1,5 +1,4 @@
1
1
  es:
2
- "Recurring Jobs": Tareas Recurrentes
3
2
  recurring_jobs: Tareas Recurrentes
4
3
  name: Nombre
5
4
  description: Descripción
data/web/locales/fr.yml CHANGED
@@ -1,5 +1,4 @@
1
1
  fr:
2
- "Recurring Jobs": Tâches récurrentes
3
2
  recurring_jobs: Tâches récurrentes
4
3
  name: Nom
5
4
  description: Description
data/web/locales/gd.yml CHANGED
@@ -1,5 +1,4 @@
1
- gd:
2
- "Recurring Jobs": Obraichean ath-chùrsach
1
+ gd:
3
2
  recurring_jobs: Obraichean ath-chùrsach
4
3
  name: Ainm
5
4
  description: Tuairisgeul
data/web/locales/it.yml CHANGED
@@ -1,5 +1,4 @@
1
1
  it:
2
- "Recurring Jobs": Job ricorrenti
3
2
  recurring_jobs: Job ricorrenti
4
3
  name: Nome
5
4
  description: Descrizione
data/web/locales/ja.yml CHANGED
@@ -1,5 +1,4 @@
1
1
  ja:
2
- "Recurring Jobs": 定期ジョブ
3
2
  recurring_jobs: 定期ジョブ
4
3
  name: 名前
5
4
  description: 説明
data/web/locales/nl.yml CHANGED
@@ -1,5 +1,4 @@
1
1
  nl:
2
- "Recurring Jobs": Herhalende taken
3
2
  recurring_jobs: Herhalende taken
4
3
  name: Naam
5
4
  description: Beschrijving
data/web/locales/pl.yml CHANGED
@@ -1,5 +1,4 @@
1
1
  pl:
2
- "Recurring Jobs": Okresowe
3
2
  recurring_jobs: Okresowe
4
3
  name: Nazwa
5
4
  description: Opis
@@ -1,5 +1,4 @@
1
1
  pt-BR:
2
- "Recurring Jobs": Jobs Recorrentes
3
2
  recurring_jobs: Jobs Recorrentes
4
3
  name: Nome
5
4
  description: Descrição
data/web/locales/ru.yml CHANGED
@@ -1,5 +1,4 @@
1
1
  ru:
2
- "Recurring Jobs": Расписание задач
3
2
  recurring_jobs: Расписание задач
4
3
  name: Название
5
4
  description: Описание
data/web/locales/sv.yml CHANGED
@@ -1,5 +1,4 @@
1
1
  sv:
2
- "Recurring Jobs": Återkommande jobb
3
2
  recurring_jobs: Återkommande jobb
4
3
  name: Namn
5
4
  description: Beskrivning
@@ -1,5 +1,4 @@
1
1
  zh-cn:
2
- "Recurring Jobs": 周期作业
3
2
  recurring_jobs: 周期作业
4
3
  name: 名称
5
4
  description: 描述
@@ -1,57 +1,55 @@
1
- <% if SidekiqScheduler::SidekiqAdapter::SIDEKIQ_GTE_7_3_0 %>
2
- <%= style_tag "recurring_jobs/stylesheets-scheduler/recurring_jobs.css" %>
3
- <% else %>
4
- <link href="<%= root_path %>recurring_jobs/stylesheets-scheduler/recurring_jobs.css" media="screen" rel="stylesheet" type="text/css" />
5
- <% end %>
1
+ <% style_tag "recurring_jobs/stylesheets-scheduler/recurring_jobs.css" %>
6
2
 
7
- <div class="row">
8
- <div class="col-sm-6">
9
- <h3><%= t('recurring_jobs') %></h3>
10
- </div>
11
- <div class="col-sm-6 toggle-all-buttons">
12
- <form action="<%= root_path %>recurring-jobs/toggle-all" method="post">
13
- <%= csrf_tag %>
14
- <button type="submit" class="btn btn-warn btn-xs" name="action" value="enable"><%= t('enable_all') %></button>
15
- <button type="submit" class="btn btn-warn btn-xs" name="action" value="disable"><%= t('disable_all') %></button>
16
- </form>
17
- <form action="<%= root_path %>recurring-jobs/new" method="post">
18
- <%= csrf_tag %>
19
- <button type="submit" class="btn btn-warn btn-xs" name="action" value="enable"><%= t('new') %></button>
20
- </form>
21
- </div>
22
- </div>
3
+ <section class="sidekiq-scheduler">
4
+ <header>
5
+ <h2><%= t('recurring_jobs') %></h2>
6
+ <div class="col-sm-6 toggle-all-buttons">
7
+ <form action="<%= root_path %>recurring-jobs/toggle-all" method="POST" class="filter">
8
+ <%= csrf_tag %>
9
+ <div class="btn-group pull-right flip">
10
+ <button type="submit" class="btn btn-xs btn-warn" name="action" value="enable"><%= t('enable_all') %></button>
11
+ <button type="submit" class="btn btn-xs btn-warn" name="action" value="disable"><%= t('disable_all') %></button>
12
+ </div>
13
+ </form>
14
+ <form action="<%= root_path %>recurring-jobs/new" method="post">
15
+ <%= csrf_tag %>
16
+ <button type="submit" class="btn btn-warn btn-xs" name="action" value="enable"><%= t('new') %></button>
17
+ </form>
18
+ </div>
19
+ </header>
23
20
 
24
- <div class="recurring-jobs">
25
- <ul class="list-group">
21
+ <section class="job-list">
26
22
  <% @presented_jobs.each do |job| %>
27
- <li class="list-group-item <%= !job.enabled? && "list-group-item-disabled" %>">
28
- <div class="title">
29
- <div class="row">
30
- <div class="col-xs-6">
31
- <span class="name"><%= job.name %></span>
32
- </div>
33
- <div class="col-xs-6 text-right">
34
- <a href="<%= root_path %>queues/<%= job.queue %>"><%= job.queue %></a>
35
- </div>
23
+ <section class="job <%= job.enabled? ? "" : "disabled-job" %>">
24
+ <div class="row">
25
+ <div class="column-2">
26
+ <div class="job-name"><%= job.name %></div>
27
+ </div>
28
+ <div class="column-2 queue">
29
+ <a href="<%= root_path %>queues/<%= job.queue %>"><%= job.queue %></a>
36
30
  </div>
37
31
  </div>
38
- <div class="description"><%= job['description'] %></div>
39
- <div class="info">
40
- <div class="row">
41
- <div class="col-md-4 class"><%= job['class'] %></div>
42
- <div class="col-md-4 interval text-left"><%= t('interval') %>: <%= job.interval %></div>
43
- <div class="col-md-4 args"><%= t('arguments') %>: <%= job['args'] %></div>
32
+
33
+ <div class="row">
34
+ <div class="column-3">
35
+ <div class="class-name"><%= job['class'] %></div>
36
+ </div>
37
+ <div class="column-3">
38
+ <div><%= t('interval') %>: <%= job.interval %></div>
39
+ </div>
40
+ <div class="column-3">
41
+ <div><%= t('arguments') %>: <%= job['args'] %></div>
44
42
  </div>
45
43
  </div>
46
- <div class="status row">
47
- <div class="col-md-4 actions">
48
- <form action="<%= root_path %>recurring-jobs/<%= ERB::Util.url_encode(job.name) %>/enqueue" method="post" class="enqueue">
44
+ <div class="row">
45
+ <div class="column-3">
46
+ <form class="inline" action="<%= root_path %>recurring-jobs/<%= ERB::Util.url_encode(job.name) %>/enqueue" method="POST">
49
47
  <%= csrf_tag %>
50
48
  <input type="submit" class="btn btn-warn btn-xs" value="<%= t('enqueue_now') %>" />
51
49
  </form>
52
- <form action="<%= root_path %>recurring-jobs/<%= ERB::Util.url_encode(job.name) %>/toggle" method="post">
50
+ <form class="inline" action="<%= root_path %>recurring-jobs/<%= ERB::Util.url_encode(job.name) %>/toggle" method="POST">
53
51
  <%= csrf_tag %>
54
- <input type="submit" class="btn <%= job.enabled? ? "btn-primary" : "btn-warn"%> btn-xs" value="<%= job.enabled? ? t('disable') : t('enable') %>" />
52
+ <input type="submit" class="btn btn-xs <%= job.enabled? ? "btn-inverse" : "btn-warn"%>" value="<%= job.enabled? ? t('disable') : t('enable') %>" />
55
53
  </form>
56
54
  <form action="<%= root_path %>recurring-jobs/<%= ERB::Util.url_encode(job.name) %>/destroy" method="post">
57
55
  <%= csrf_tag %>
@@ -62,16 +60,17 @@
62
60
  <input type="submit" class="btn <%= job.enabled? ? "btn-primary" : "btn-warn"%> btn-xs" value="<%= t('edit') %>" />
63
61
  </form>
64
62
  </div>
65
- <div class="col-md-4">
66
- <span class="last_time"><%= t('last_time') %>: <%= job.last_time %></span>
63
+ <div class="column-3">
64
+ <div class="last-time"><%= t('last_time') %>: <%= job.last_time %></div>
67
65
  </div>
68
- <div class="col-md-4">
69
- <span class="next_time text-right" style="<%= 'text-decoration:line-through' unless job.enabled? %>">
70
- <%= t('next_time') %>: <%= job.next_time || t('no_next_time') %>
71
- </span>
66
+ <div class="column-3">
67
+ <div class="next-time"><%= t('next_time') %>: <%= job.next_time || t('no_next_time') %></div>
72
68
  </div>
69
+
73
70
  </div>
74
- </li>
71
+ <div class="description"><%= job['description'] %></div>
72
+
73
+ </section>
75
74
  <% end %>
76
- </ul>
77
- </div>
75
+ </section>
76
+ </section>
@@ -0,0 +1,61 @@
1
+ <%= style_tag "recurring_jobs/stylesheets-scheduler/recurring_jobs_73.css" %>
2
+
3
+ <div class="row">
4
+ <div class="col-sm-6">
5
+ <h3><%= t('recurring_jobs') %></h3>
6
+ </div>
7
+ <div class="col-sm-6 toggle-all-buttons">
8
+ <form action="<%= root_path %>recurring-jobs/toggle-all" method="post">
9
+ <%= csrf_tag %>
10
+ <button type="submit" class="btn btn-warn btn-xs" name="action" value="enable"><%= t('enable_all') %></button>
11
+ <button type="submit" class="btn btn-warn btn-xs" name="action" value="disable"><%= t('disable_all') %></button>
12
+ </form>
13
+ </div>
14
+ </div>
15
+
16
+ <div class="recurring-jobs">
17
+ <ul class="list-group">
18
+ <% @presented_jobs.each do |job| %>
19
+ <li class="list-group-item <%= !job.enabled? && "list-group-item-disabled" %>">
20
+ <div class="title">
21
+ <div class="row">
22
+ <div class="col-xs-6">
23
+ <span class="name"><%= job.name %></span>
24
+ </div>
25
+ <div class="col-xs-6 text-right">
26
+ <a href="<%= root_path %>queues/<%= job.queue %>"><%= job.queue %></a>
27
+ </div>
28
+ </div>
29
+ </div>
30
+ <div class="description"><%= job['description'] %></div>
31
+ <div class="info">
32
+ <div class="row">
33
+ <div class="col-md-4 class"><%= job['class'] %></div>
34
+ <div class="col-md-4 interval text-left"><%= t('interval') %>: <%= job.interval %></div>
35
+ <div class="col-md-4 args"><%= t('arguments') %>: <%= job['args'] %></div>
36
+ </div>
37
+ </div>
38
+ <div class="status row">
39
+ <div class="col-md-4 actions">
40
+ <form action="<%= root_path %>recurring-jobs/<%= ERB::Util.url_encode(job.name) %>/enqueue" method="post" class="enqueue">
41
+ <%= csrf_tag %>
42
+ <input type="submit" class="btn btn-warn btn-xs" value="<%= t('enqueue_now') %>" />
43
+ </form>
44
+ <form action="<%= root_path %>recurring-jobs/<%= ERB::Util.url_encode(job.name) %>/toggle" method="post">
45
+ <%= csrf_tag %>
46
+ <input type="submit" class="btn <%= job.enabled? ? "btn-primary" : "btn-warn"%> btn-xs" value="<%= job.enabled? ? t('disable') : t('enable') %>" />
47
+ </form>
48
+ </div>
49
+ <div class="col-md-4">
50
+ <span class="last_time"><%= t('last_time') %>: <%= job.last_time %></span>
51
+ </div>
52
+ <div class="col-md-4">
53
+ <span class="next_time text-right" style="<%= 'text-decoration:line-through' unless job.enabled? %>">
54
+ <%= t('next_time') %>: <%= job.next_time || t('no_next_time') %>
55
+ </span>
56
+ </div>
57
+ </div>
58
+ </li>
59
+ <% end %>
60
+ </ul>
61
+ </div>
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dynamodb-sidekiq-scheduler
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.5'
4
+ version: '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-12-12 00:00:00.000000000 Z
13
+ date: 2026-05-01 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: sidekiq
@@ -18,20 +18,20 @@ dependencies:
18
18
  requirements:
19
19
  - - ">="
20
20
  - !ruby/object:Gem::Version
21
- version: '6'
21
+ version: '7.3'
22
22
  - - "<"
23
23
  - !ruby/object:Gem::Version
24
- version: '8'
24
+ version: '9'
25
25
  type: :runtime
26
26
  prerelease: false
27
27
  version_requirements: !ruby/object:Gem::Requirement
28
28
  requirements:
29
29
  - - ">="
30
30
  - !ruby/object:Gem::Version
31
- version: '6'
31
+ version: '7.3'
32
32
  - - "<"
33
33
  - !ruby/object:Gem::Version
34
- version: '8'
34
+ version: '9'
35
35
  - !ruby/object:Gem::Dependency
36
36
  name: rufus-scheduler
37
37
  requirement: !ruby/object:Gem::Requirement
@@ -150,28 +150,14 @@ dependencies:
150
150
  requirements:
151
151
  - - ">="
152
152
  - !ruby/object:Gem::Version
153
- version: '0'
153
+ version: '1.1'
154
154
  type: :development
155
155
  prerelease: false
156
156
  version_requirements: !ruby/object:Gem::Requirement
157
157
  requirements:
158
158
  - - ">="
159
159
  - !ruby/object:Gem::Version
160
- version: '0'
161
- - !ruby/object:Gem::Dependency
162
- name: rack
163
- requirement: !ruby/object:Gem::Requirement
164
- requirements:
165
- - - "<"
166
- - !ruby/object:Gem::Version
167
- version: '3'
168
- type: :development
169
- prerelease: false
170
- version_requirements: !ruby/object:Gem::Requirement
171
- requirements:
172
- - - "<"
173
- - !ruby/object:Gem::Version
174
- version: '3'
160
+ version: '1.1'
175
161
  description: Light weight job scheduling extension for Sidekiq that adds support for
176
162
  queueing jobs in a recurring way.
177
163
  email:
@@ -201,6 +187,7 @@ files:
201
187
  - lib/sidekiq-scheduler/web.rb
202
188
  - lib/sidekiq/scheduler.rb
203
189
  - web/assets/recurring_jobs/stylesheets-scheduler/recurring_jobs.css
190
+ - web/assets/recurring_jobs/stylesheets-scheduler/recurring_jobs_73.css
204
191
  - web/locales/cs.yml
205
192
  - web/locales/de.yml
206
193
  - web/locales/en.yml
@@ -217,11 +204,15 @@ files:
217
204
  - web/locales/zh-cn.yml
218
205
  - web/views/recurring_job.erb
219
206
  - web/views/recurring_jobs.erb
207
+ - web/views/sidekiq73/recurring_jobs.erb
220
208
  homepage: https://sidekiq-scheduler.github.io/sidekiq-scheduler/
221
209
  licenses:
222
210
  - MIT
223
211
  metadata:
224
212
  rubygems_mfa_required: 'true'
213
+ source_code_uri: https://github.com/sidekiq-scheduler/sidekiq-scheduler
214
+ bug_tracker_uri: https://github.com/sidekiq-scheduler/sidekiq-scheduler/issues
215
+ changelog_uri: https://github.com/sidekiq-scheduler/sidekiq-scheduler/blob/master/CHANGELOG.md
225
216
  post_install_message:
226
217
  rdoc_options: []
227
218
  require_paths: