sidekiq-scheduler 5.0.6 → 6.0.0.beta1

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: a2d6cf0887d66e27d2ce10ec96eabcb2b89bd89c515af8e38d54b366b38a8df2
4
- data.tar.gz: c0da1db9ad45afdaf3b6055ce22ccc24ac90a392f7a2b5787136bbdeb6456fd5
3
+ metadata.gz: 912d4874af78cd3092ce7807235712fb38455291243e86b3fab871445a29fbd8
4
+ data.tar.gz: 0a65678172f220908cae365d54ed8f9912cf65fd47583a37d5ff61752dce3bd9
5
5
  SHA512:
6
- metadata.gz: 7d845a756d2ba958cfedadcf52f6ba6f19811eb5b88c94fc50989b6a6f2bf523dbc7d2f8eb8e44c9d0c20a483f5896e5c313e5428f2369368de12479a2472163
7
- data.tar.gz: 797ebac76066faa408f2f43290f6aead6a4ff335cb966811efdeea5c70c7ca5a4f93e6bda15f864987294e505583999bff64d05f33f2f2b9d0c92f512487d905
6
+ metadata.gz: 4a231389e5e216ed5679440f4f1264b32afb8fab63fd78432c0e66f35b94d32f8255d44806762fbba3e4d189588715d5b28cf8655d940de4cd342b8d9be53b16
7
+ data.tar.gz: fde5cec33e44141229eeded5d5a3d9185310511e8be2f8e80b026483a58beff0f1ed7f4b934f55338a6439a831ae526227548305c4322aba62170ec34e616859
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ # 6.0.0.beta1
2
+ - [**ENHANCEMENT**] Adds compatibility with Sidekiq 8 [#497](https://github.com/sidekiq-scheduler/sidekiq-scheduler/pull/497)
3
+ - [**BREAKING CHANGE**] Drop support for Sidekiq 7.2 and earlier [#497](https://github.com/sidekiq-scheduler/sidekiq-scheduler/pull/498)
4
+
1
5
  # 5.0.6
2
6
  - [**FIX**] Fix typo in `config#to_hash` method [#479](https://github.com/sidekiq-scheduler/sidekiq-scheduler/pull/479)
3
7
  - [**FIX**] Correctly clear scheduled jobs with Scheduler#clear_schedule! [#485](https://github.com/sidekiq-scheduler/sidekiq-scheduler/pull/485)
@@ -18,7 +22,7 @@
18
22
  - [**FIX**] Prevent stack level too deep error by implementing `to_hash` method [#470](https://github.com/sidekiq-scheduler/sidekiq-scheduler/pull/470)
19
23
  - [**ENHANCEMENT**] Support new Sidekiq model for registering UI plugins [#472](https://github.com/sidekiq-scheduler/sidekiq-scheduler/pull/472)
20
24
  - [**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)
25
+ - [**ENHANCEMENT**] Display `at` and `in` in the dashboard [#291](https://github.com/sidekiq-scheduler/sidekiq-scheduler/pull/291)
22
26
  - [**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
27
 
24
28
 
@@ -40,7 +44,7 @@
40
44
  - [**ENHANCEMENT**] Adds Ruby 3.2 to the CI matrix. [#420](https://github.com/sidekiq-scheduler/sidekiq-scheduler/pull/420)
41
45
  - [**DOCS**] README: refer to v5 as released. [#421](https://github.com/sidekiq-scheduler/sidekiq-scheduler/pull/421)
42
46
  - [**FIX**] Fix dependency on Rails `.present?` method. [#425](https://github.com/sidekiq-scheduler/sidekiq-scheduler/pull/425)
43
-
47
+
44
48
  # 5.0.0
45
49
 
46
50
  - [**FIX**] Ensure generated scheduled time has a precision of 3 milliseconds. [#418](https://github.com/sidekiq-scheduler/sidekiq-scheduler/pull/418)
@@ -59,7 +63,7 @@
59
63
  - [**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
64
  - 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
65
  - 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
-
66
+
63
67
  - [**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
68
 
65
69
  - [**FIX**] Add support for Sidekiq 7 [#410](https://github.com/sidekiq-scheduler/sidekiq-scheduler/pull/410)
@@ -98,4 +102,4 @@
98
102
  - [**FIX**] Fixes redis deprecation warning regarding `exists` [#370](https://github.com/sidekiq-scheduler/sidekiq-scheduler/pull/370)
99
103
  - [**BREAKING CHANGE**] Remove dependency on thwait and e2mmap [#371](https://github.com/sidekiq-scheduler/sidekiq-scheduler/pull/371)
100
104
  - 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)
105
+ - [**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
 
@@ -37,7 +37,7 @@ gem install sidekiq-scheduler
37
37
  require 'sidekiq-scheduler'
38
38
 
39
39
  class HelloWorld
40
- include Sidekiq::Worker
40
+ include Sidekiq::Job
41
41
 
42
42
  def perform
43
43
  puts 'Hello world'
@@ -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,9 +1,8 @@
1
1
  require 'sidekiq/web' unless defined?(Sidekiq::Web)
2
2
 
3
- if SidekiqScheduler::SidekiqAdapter::SIDEKIQ_GTE_7_3_0
4
-
5
- # Locale and asset cache is configured in `.register`
6
- Sidekiq::Web.register(SidekiqScheduler::Web,
3
+ # Locale and asset cache is configured in `cfg.register`
4
+ Sidekiq::Web.configure do |cfg|
5
+ cfg.register(SidekiqScheduler::Web,
7
6
  name: "recurring_jobs",
8
7
  tab: ["Recurring Jobs"],
9
8
  index: ["recurring-jobs"],
@@ -11,17 +10,4 @@ if SidekiqScheduler::SidekiqAdapter::SIDEKIQ_GTE_7_3_0
11
10
  asset_paths: ["stylesheets-scheduler"]) do |app|
12
11
  # add middleware or additional settings here
13
12
  end
14
-
15
- 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' }]]
27
13
  end
@@ -2,89 +2,51 @@ module SidekiqScheduler
2
2
  class OptionNotSupportedAnymore < StandardError; end
3
3
 
4
4
  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
5
  SIDEKIQ_GTE_7_3_0 = Gem::Version.new(Sidekiq::VERSION) >= Gem::Version.new('7.3.0')
6
+ SIDEKIQ_GTE_8_0_0 = Gem::Version.new(Sidekiq::VERSION) >= Gem::Version.new('8.0.0')
8
7
 
9
8
  def self.fetch_scheduler_config_from_sidekiq(sidekiq_config)
10
9
  return {} if sidekiq_config.nil?
11
10
 
12
11
  check_using_old_sidekiq_scheduler_config!(sidekiq_config)
13
12
 
14
- if SIDEKIQ_GTE_6_5_0
15
- sidekiq_config.fetch(:scheduler, {})
16
- else
17
- sidekiq_config.options.fetch(:scheduler, {})
18
- end
13
+ sidekiq_config.fetch(:scheduler, {})
19
14
  end
20
15
 
21
16
  def self.check_using_old_sidekiq_scheduler_config!(sidekiq_config)
22
17
  %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
18
+ if sidekiq_config.key?(option)
19
+ raise OptionNotSupportedAnymore, ":#{option} option should be under the :scheduler: key"
35
20
  end
36
21
  end
37
22
  end
38
23
 
39
24
  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
25
+ sidekiq_config[:schedule_manager] = schedule_manager
26
+ sidekiq_config[:schedule_manager].start
47
27
  end
48
28
 
49
29
  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
30
+ sidekiq_config[:schedule_manager].stop
55
31
  end
56
32
 
57
33
  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)
34
+ if sidekiq_config.nil? || (sidekiq_config.respond_to?(:empty?) && sidekiq_config.empty?)
35
+ Sidekiq.instance_variable_get(:@config).queues.map(&:to_s)
66
36
  else
67
- Sidekiq.options[:queues].map(&:to_s)
37
+ sidekiq_config.queues.map(&:to_s)
68
38
  end
69
39
  end
70
40
 
71
41
  def self.redis_key_exists?(key_name)
72
42
  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
43
+ r.exists(key_name) > 0
78
44
  end
79
45
  end
80
46
 
81
47
  def self.redis_zrangebyscore(key, from, to)
82
48
  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
49
+ r.zrange(key, from, to, "BYSCORE")
88
50
  end
89
51
  end
90
52
  end
@@ -1,3 +1,3 @@
1
1
  module SidekiqScheduler
2
- VERSION = "5.0.6"
2
+ VERSION = "6.0.0.beta1"
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,12 +44,12 @@ 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
 
31
51
  app.post '/recurring-jobs/toggle-all' do
32
- SidekiqScheduler::Scheduler.instance.toggle_all_jobs(params[:action] == 'enable')
52
+ SidekiqScheduler::Scheduler.instance.toggle_all_jobs(sidekiq_scheduler_fetch_url_param(:action) == 'enable')
33
53
  redirect "#{root_path}recurring-jobs"
34
54
  end
35
55
  end
@@ -1,5 +1,4 @@
1
1
  require 'sidekiq'
2
- require 'tilt/erb'
3
2
 
4
3
  require_relative 'sidekiq/scheduler'
5
4
  require_relative 'sidekiq-scheduler/version'
@@ -1,42 +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;
10
+ }
11
+
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;
15
30
  }
16
31
 
17
- .list-group-item-disabled {
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;
61
+ .sidekiq-scheduler .job.disabled-job {
62
+ background-color: #4f0b0b;
26
63
  }
27
64
  }
28
65
 
29
- .toggle-all-buttons {
30
- margin-top: 20px;
31
- margin-bottom: 10px;
32
- line-height: 45px;
33
- text-align: right;
66
+ .sidekiq-scheduler .disabled-job .next-time {
67
+ text-decoration: line-through;
34
68
  }
35
69
 
36
- @media (max-width: 768px) {
37
- .toggle-all-buttons {
38
- 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 {
39
79
  text-align: left;
40
- line-height: inherit;
41
80
  }
42
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
+ }
@@ -1,65 +1,62 @@
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">
3
+ <section class="sidekiq-scheduler">
4
+ <header>
5
+ <h2><%= t('recurring_jobs') %></h2>
6
+ <form action="<%= root_path %>recurring-jobs/toggle-all" method="POST" class="filter">
13
7
  <%= 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>
8
+ <div class="btn-group pull-right flip">
9
+ <button type="submit" class="btn btn-xs btn-warn" name="action" value="enable"><%= t('enable_all') %></button>
10
+ <button type="submit" class="btn btn-xs btn-warn" name="action" value="disable"><%= t('disable_all') %></button>
11
+ </div>
16
12
  </form>
17
- </div>
18
- </div>
13
+ </header>
19
14
 
20
- <div class="recurring-jobs">
21
- <ul class="list-group">
15
+ <section class="job-list">
22
16
  <% @presented_jobs.each do |job| %>
23
- <li class="list-group-item <%= !job.enabled? && "list-group-item-disabled" %>">
24
- <div class="title">
25
- <div class="row">
26
- <div class="col-xs-6">
27
- <span class="name"><%= job.name %></span>
28
- </div>
29
- <div class="col-xs-6 text-right">
30
- <a href="<%= root_path %>queues/<%= job.queue %>"><%= job.queue %></a>
31
- </div>
17
+ <section class="job <%= job.enabled? ? "" : "disabled-job" %>">
18
+ <div class="row">
19
+ <div class="column-2">
20
+ <div class="job-name"><%= job.name %></div>
21
+ </div>
22
+ <div class="column-2 queue">
23
+ <a href="<%= root_path %>queues/<%= job.queue %>"><%= job.queue %></a>
32
24
  </div>
33
25
  </div>
34
- <div class="description"><%= job['description'] %></div>
35
- <div class="info">
36
- <div class="row">
37
- <div class="col-md-4 class"><%= job['class'] %></div>
38
- <div class="col-md-4 interval text-left"><%= t('interval') %>: <%= job.interval %></div>
39
- <div class="col-md-4 args"><%= t('arguments') %>: <%= job['args'] %></div>
26
+
27
+ <div class="row">
28
+ <div class="column-3">
29
+ <div class="class-name"><%= job['class'] %></div>
30
+ </div>
31
+ <div class="column-3">
32
+ <div><%= t('interval') %>: <%= job.interval %></div>
33
+ </div>
34
+ <div class="column-3">
35
+ <div><%= t('arguments') %>: <%= job['args'] %></div>
40
36
  </div>
41
37
  </div>
42
- <div class="status row">
43
- <div class="col-md-4 actions">
44
- <form action="<%= root_path %>recurring-jobs/<%= ERB::Util.url_encode(job.name) %>/enqueue" method="post" class="enqueue">
38
+ <div class="row">
39
+ <div class="column-3">
40
+ <form class="inline" action="<%= root_path %>recurring-jobs/<%= ERB::Util.url_encode(job.name) %>/enqueue" method="POST">
45
41
  <%= csrf_tag %>
46
42
  <input type="submit" class="btn btn-warn btn-xs" value="<%= t('enqueue_now') %>" />
47
43
  </form>
48
- <form action="<%= root_path %>recurring-jobs/<%= ERB::Util.url_encode(job.name) %>/toggle" method="post">
44
+ <form class="inline" action="<%= root_path %>recurring-jobs/<%= ERB::Util.url_encode(job.name) %>/toggle" method="POST">
49
45
  <%= csrf_tag %>
50
- <input type="submit" class="btn <%= job.enabled? ? "btn-primary" : "btn-warn"%> btn-xs" value="<%= job.enabled? ? t('disable') : t('enable') %>" />
46
+ <input type="submit" class="btn btn-xs <%= job.enabled? ? "btn-inverse" : "btn-warn"%>" value="<%= job.enabled? ? t('disable') : t('enable') %>" />
51
47
  </form>
52
48
  </div>
53
- <div class="col-md-4">
54
- <span class="last_time"><%= t('last_time') %>: <%= job.last_time %></span>
49
+ <div class="column-3">
50
+ <div class="last-time"><%= t('last_time') %>: <%= job.last_time %></div>
55
51
  </div>
56
- <div class="col-md-4">
57
- <span class="next_time text-right" style="<%= 'text-decoration:line-through' unless job.enabled? %>">
58
- <%= t('next_time') %>: <%= job.next_time || t('no_next_time') %>
59
- </span>
52
+ <div class="column-3">
53
+ <div class="next-time"><%= t('next_time') %>: <%= job.next_time || t('no_next_time') %></div>
60
54
  </div>
55
+
61
56
  </div>
62
- </li>
57
+ <div class="description"><%= job['description'] %></div>
58
+
59
+ </section>
63
60
  <% end %>
64
- </ul>
65
- </div>
61
+ </section>
62
+ </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,16 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sidekiq-scheduler
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.0.6
4
+ version: 6.0.0.beta1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Morton Jonuschat
8
8
  - Moove-it
9
9
  - Marcelo Lauxen
10
- autorequire:
11
10
  bindir: bin
12
11
  cert_chain: []
13
- date: 2024-08-01 00:00:00.000000000 Z
12
+ date: 2025-04-08 00:00:00.000000000 Z
14
13
  dependencies:
15
14
  - !ruby/object:Gem::Dependency
16
15
  name: sidekiq
@@ -18,20 +17,20 @@ dependencies:
18
17
  requirements:
19
18
  - - ">="
20
19
  - !ruby/object:Gem::Version
21
- version: '6'
20
+ version: '7.3'
22
21
  - - "<"
23
22
  - !ruby/object:Gem::Version
24
- version: '8'
23
+ version: '9'
25
24
  type: :runtime
26
25
  prerelease: false
27
26
  version_requirements: !ruby/object:Gem::Requirement
28
27
  requirements:
29
28
  - - ">="
30
29
  - !ruby/object:Gem::Version
31
- version: '6'
30
+ version: '7.3'
32
31
  - - "<"
33
32
  - !ruby/object:Gem::Version
34
- version: '8'
33
+ version: '9'
35
34
  - !ruby/object:Gem::Dependency
36
35
  name: rufus-scheduler
37
36
  requirement: !ruby/object:Gem::Requirement
@@ -46,26 +45,6 @@ dependencies:
46
45
  - - "~>"
47
46
  - !ruby/object:Gem::Version
48
47
  version: '3.2'
49
- - !ruby/object:Gem::Dependency
50
- name: tilt
51
- requirement: !ruby/object:Gem::Requirement
52
- requirements:
53
- - - ">="
54
- - !ruby/object:Gem::Version
55
- version: 1.4.0
56
- - - "<"
57
- - !ruby/object:Gem::Version
58
- version: '3'
59
- type: :runtime
60
- prerelease: false
61
- version_requirements: !ruby/object:Gem::Requirement
62
- requirements:
63
- - - ">="
64
- - !ruby/object:Gem::Version
65
- version: 1.4.0
66
- - - "<"
67
- - !ruby/object:Gem::Version
68
- version: '3'
69
48
  - !ruby/object:Gem::Dependency
70
49
  name: rake
71
50
  requirement: !ruby/object:Gem::Requirement
@@ -170,28 +149,14 @@ dependencies:
170
149
  requirements:
171
150
  - - ">="
172
151
  - !ruby/object:Gem::Version
173
- version: '0'
152
+ version: '1.1'
174
153
  type: :development
175
154
  prerelease: false
176
155
  version_requirements: !ruby/object:Gem::Requirement
177
156
  requirements:
178
157
  - - ">="
179
158
  - !ruby/object:Gem::Version
180
- version: '0'
181
- - !ruby/object:Gem::Dependency
182
- name: rack
183
- requirement: !ruby/object:Gem::Requirement
184
- requirements:
185
- - - "<"
186
- - !ruby/object:Gem::Version
187
- version: '3'
188
- type: :development
189
- prerelease: false
190
- version_requirements: !ruby/object:Gem::Requirement
191
- requirements:
192
- - - "<"
193
- - !ruby/object:Gem::Version
194
- version: '3'
159
+ version: '1.1'
195
160
  description: Light weight job scheduling extension for Sidekiq that adds support for
196
161
  queueing jobs in a recurring way.
197
162
  email:
@@ -221,6 +186,7 @@ files:
221
186
  - lib/sidekiq-scheduler/web.rb
222
187
  - lib/sidekiq/scheduler.rb
223
188
  - web/assets/recurring_jobs/stylesheets-scheduler/recurring_jobs.css
189
+ - web/assets/recurring_jobs/stylesheets-scheduler/recurring_jobs_73.css
224
190
  - web/locales/cs.yml
225
191
  - web/locales/de.yml
226
192
  - web/locales/en.yml
@@ -236,12 +202,12 @@ files:
236
202
  - web/locales/sv.yml
237
203
  - web/locales/zh-cn.yml
238
204
  - web/views/recurring_jobs.erb
205
+ - web/views/sidekiq73/recurring_jobs.erb
239
206
  homepage: https://sidekiq-scheduler.github.io/sidekiq-scheduler/
240
207
  licenses:
241
208
  - MIT
242
209
  metadata:
243
210
  rubygems_mfa_required: 'true'
244
- post_install_message:
245
211
  rdoc_options: []
246
212
  require_paths:
247
213
  - lib
@@ -256,8 +222,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
256
222
  - !ruby/object:Gem::Version
257
223
  version: '0'
258
224
  requirements: []
259
- rubygems_version: 3.5.3
260
- signing_key:
225
+ rubygems_version: 3.6.2
261
226
  specification_version: 4
262
227
  summary: Light weight job scheduling extension for Sidekiq
263
228
  test_files: []