mini_scheduler 0.17.0 → 0.18.0

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: '08b8517cbb1f57938ca8337f54bd804e402d176070934398dfd53ab1b00b5b2f'
4
- data.tar.gz: 2d70f148236b793e71d276e5acd72403d4945a23d33f36121f081ec7b2ee3f0e
3
+ metadata.gz: 3b5d08632e54389302df347b8c5c938b7d3693d63c126009b537a0a26532c239
4
+ data.tar.gz: 5db6eea6cae5c21efec10310b87e0ab4d8f7211512467547cae56e6888cbcf55
5
5
  SHA512:
6
- metadata.gz: fa584d657e08dfbcfd0f0f7dc05d7da2b4884423a7140afbeedf8381b5dc475823c312e0c08e0ecf0a7461fc0c6cc36f39e19df0d4a80d35b03135431d300a64
7
- data.tar.gz: a1c34182f330304932e95a94c75a9366444be9bbedf88fc41cb3c8d359de13d5f1bdda957966b1399b66d96e901dcc165f34d5f456f6e521e070ac539ea5f107
6
+ metadata.gz: 2e3d947fa7227bc58774576778f5e42989bb1adcc5e28fc891a5faef504ac30e49a455216fdecbb5d7861fe21574e3db7ec4adb6a9e12ac006916374f9f4cc53
7
+ data.tar.gz: e3c519534c28c36f5067c02eb12953d64e7a41e96b45fb8da7d7aee05cbfc83906139be971a5681468f3bbbbab8b04cf5424997f2f829ad217a3f9a7150f452a
data/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ # 0.18.0 - 2024-12-20
2
+
3
+ - Add support for Sidekiq 7+
4
+ - Remove support for Sidekiq < 6.5
5
+ - Update minimum Ruby version to 3.0
6
+
1
7
  # 0.17.0 - 2024-08-06
2
8
 
3
9
  - Add `MiniScheduler::Manager.discover_running_scheduled_jobs` API to allow running scheduled jobs to easily be discovered on the
@@ -0,0 +1,6 @@
1
+ # frozen_string_literal: true
2
+ source "https://rubygems.org"
3
+
4
+ gemspec path: ".."
5
+
6
+ gem "sidekiq", "~> 6.5.0"
@@ -0,0 +1,6 @@
1
+ # frozen_string_literal: true
2
+ source "https://rubygems.org"
3
+
4
+ gemspec path: ".."
5
+
6
+ gem "sidekiq", "~> 7.0.0"
@@ -0,0 +1,6 @@
1
+ # frozen_string_literal: true
2
+ source "https://rubygems.org"
3
+
4
+ gemspec path: ".."
5
+
6
+ gem "sidekiq", "~> 7.1.0"
@@ -0,0 +1,6 @@
1
+ # frozen_string_literal: true
2
+ source "https://rubygems.org"
3
+
4
+ gemspec path: ".."
5
+
6
+ gem "sidekiq", "~> 7.2.0"
@@ -0,0 +1,6 @@
1
+ # frozen_string_literal: true
2
+ source "https://rubygems.org"
3
+
4
+ gemspec path: ".."
5
+
6
+ gem "sidekiq", "~> 7.3.0"
@@ -394,10 +394,10 @@ module MiniScheduler
394
394
  begin
395
395
  require "socket"
396
396
  Socket.gethostname
397
- rescue => e
397
+ rescue StandardError
398
398
  begin
399
399
  `hostname`.strip
400
- rescue => e
400
+ rescue StandardError
401
401
  "unknown_host"
402
402
  end
403
403
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module MiniScheduler
4
- VERSION = "0.17.0"
4
+ VERSION = "0.18.0"
5
5
  end
@@ -5,6 +5,7 @@ require "mini_scheduler/schedule_info"
5
5
  require "mini_scheduler/manager"
6
6
  require "mini_scheduler/distributed_mutex"
7
7
  require "sidekiq"
8
+ require "redis"
8
9
 
9
10
  begin
10
11
  require "sidekiq/exception_handler"
@@ -16,26 +17,23 @@ module MiniScheduler
16
17
  yield self
17
18
  end
18
19
 
19
- class SidekiqExceptionHandler
20
- if defined?(Sidekiq::ExceptionHandler)
21
- extend Sidekiq::ExceptionHandler
22
- else
23
- def self.handle_exception(exception, context)
24
- Sidekiq.handle_exception(exception, context)
25
- end
20
+ SidekiqExceptionHandler =
21
+ if defined?(Sidekiq.default_configuration) # Sidekiq 7+
22
+ ->(ex, ctx, _config = nil) { Sidekiq.default_configuration.handle_exception(ex, ctx) }
23
+ else # Sidekiq 6.5
24
+ ->(ex, ctx, _config = nil) { Sidekiq.handle_exception(ex, ctx) }
26
25
  end
27
- end
28
26
 
29
27
  def self.job_exception_handler(&blk)
30
28
  @job_exception_handler = blk if blk
31
29
  @job_exception_handler
32
30
  end
33
31
 
34
- def self.handle_job_exception(ex, context = {})
32
+ def self.handle_job_exception(ex, context = {}, _config = nil)
35
33
  if job_exception_handler
36
34
  job_exception_handler.call(ex, context)
37
35
  else
38
- SidekiqExceptionHandler.handle_exception(ex, context)
36
+ SidekiqExceptionHandler.call(ex, context)
39
37
  end
40
38
  end
41
39
 
@@ -15,12 +15,12 @@ Gem::Specification.new do |spec|
15
15
  spec.homepage = "https://github.com/discourse/mini_scheduler"
16
16
  spec.license = "MIT"
17
17
 
18
- spec.required_ruby_version = ">= 2.7.0"
18
+ spec.required_ruby_version = ">= 3.0.0"
19
19
 
20
20
  spec.files = `git ls-files`.split($/).reject { |s| s =~ /^(spec|\.)/ }
21
21
  spec.require_paths = ["lib"]
22
22
 
23
- spec.add_runtime_dependency "sidekiq", ">= 4.2.3", "< 7.0"
23
+ spec.add_runtime_dependency "sidekiq", ">= 6.5", "< 8.0"
24
24
 
25
25
  spec.add_development_dependency "pg", "~> 1.0"
26
26
  spec.add_development_dependency "activesupport", "~> 7.0"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mini_scheduler
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.17.0
4
+ version: 0.18.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sam Saffron
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2024-08-08 00:00:00.000000000 Z
12
+ date: 2024-12-20 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: sidekiq
@@ -17,20 +17,20 @@ dependencies:
17
17
  requirements:
18
18
  - - ">="
19
19
  - !ruby/object:Gem::Version
20
- version: 4.2.3
20
+ version: '6.5'
21
21
  - - "<"
22
22
  - !ruby/object:Gem::Version
23
- version: '7.0'
23
+ version: '8.0'
24
24
  type: :runtime
25
25
  prerelease: false
26
26
  version_requirements: !ruby/object:Gem::Requirement
27
27
  requirements:
28
28
  - - ">="
29
29
  - !ruby/object:Gem::Version
30
- version: 4.2.3
30
+ version: '6.5'
31
31
  - - "<"
32
32
  - !ruby/object:Gem::Version
33
- version: '7.0'
33
+ version: '8.0'
34
34
  - !ruby/object:Gem::Dependency
35
35
  name: pg
36
36
  requirement: !ruby/object:Gem::Requirement
@@ -184,6 +184,11 @@ files:
184
184
  - README.md
185
185
  - Rakefile
186
186
  - app/models/mini_scheduler/stat.rb
187
+ - gemfiles/sidekiq-6.5.gemfile
188
+ - gemfiles/sidekiq-7.0.gemfile
189
+ - gemfiles/sidekiq-7.1.gemfile
190
+ - gemfiles/sidekiq-7.2.gemfile
191
+ - gemfiles/sidekiq-7.3.gemfile
187
192
  - lib/generators/mini_scheduler/install/install_generator.rb
188
193
  - lib/generators/mini_scheduler/install/templates/create_mini_scheduler_stats.rb
189
194
  - lib/generators/mini_scheduler/install/templates/mini_scheduler_initializer.rb
@@ -210,14 +215,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
210
215
  requirements:
211
216
  - - ">="
212
217
  - !ruby/object:Gem::Version
213
- version: 2.7.0
218
+ version: 3.0.0
214
219
  required_rubygems_version: !ruby/object:Gem::Requirement
215
220
  requirements:
216
221
  - - ">="
217
222
  - !ruby/object:Gem::Version
218
223
  version: '0'
219
224
  requirements: []
220
- rubygems_version: 3.5.11
225
+ rubygems_version: 3.5.22
221
226
  signing_key:
222
227
  specification_version: 4
223
228
  summary: Adds recurring jobs for Sidekiq