sidekiq-belt 0.3.1 → 0.3.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/sidekiq/belt/ent/files.rb +8 -4
- data/lib/sidekiq/belt/ent/periodic_sort.rb +24 -0
- data/lib/sidekiq/belt/version.rb +1 -1
- data/lib/sidekiq/web_action_helper.rb +3 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e1d58a367e0ec0d41fb826a95a5b61cc59c6431fd5d50f235786cb3521e1ac69
|
4
|
+
data.tar.gz: 2cf1947d6e5ca5b54fe9989ec5a30e09923474412bce3d65475a13aa693d29fd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8f8b2a0e54438fc416a638c3de38bcdccd187eea0363863d33ec04a2aa97dfc97983548445ab1f7f15148837123dccdad11cc47274ac59287e473c1223189b78
|
7
|
+
data.tar.gz: 6467a245b671d70c33b759b579f1ea12d4adf48c0bde494979e39d8c6663468859fc147f9f9add16ac967a9249e3ae6ac50476078fb59629167a14d5aeffa610
|
data/CHANGELOG.md
CHANGED
@@ -4,6 +4,7 @@ require "sidekiq"
|
|
4
4
|
|
5
5
|
require_relative "periodic_pause"
|
6
6
|
require_relative "periodic_run"
|
7
|
+
require_relative "periodic_sort"
|
7
8
|
|
8
9
|
module Sidekiq
|
9
10
|
module Belt
|
@@ -12,13 +13,16 @@ module Sidekiq
|
|
12
13
|
def self.use!(options = [:all])
|
13
14
|
return unless Sidekiq.ent?
|
14
15
|
|
15
|
-
|
16
|
-
|
17
|
-
Sidekiq::Belt::Ent::
|
18
|
-
Sidekiq::Belt::Ent::PeriodicRun.use! if all || options.include?(:periodic_run)
|
16
|
+
Sidekiq::Belt::Ent::PeriodicPause.use! if should_use?(:periodic_pause, options)
|
17
|
+
Sidekiq::Belt::Ent::PeriodicRun.use! if should_use?(:periodic_run, options)
|
18
|
+
Sidekiq::Belt::Ent::PeriodicSort.use! if should_use?(:periodic_sort, options)
|
19
19
|
|
20
20
|
true
|
21
21
|
end
|
22
|
+
|
23
|
+
def self.should_use?(key, options)
|
24
|
+
options.include?(:all) || options.include?(key)
|
25
|
+
end
|
22
26
|
end
|
23
27
|
end
|
24
28
|
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "sidekiq/web/helpers"
|
4
|
+
|
5
|
+
module Sidekiq
|
6
|
+
module Belt
|
7
|
+
module Ent
|
8
|
+
module PeriodicSort
|
9
|
+
module SidekiqLoopsPeriodicSort
|
10
|
+
def each(&block)
|
11
|
+
@lids.map { |lid| Sidekiq::Periodic::Loop.new(lid) }.sort_by(&:klass).each(&block)
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
def self.use!
|
16
|
+
require("sidekiq-ent/periodic")
|
17
|
+
require("sidekiq-ent/periodic/static_loop")
|
18
|
+
|
19
|
+
Sidekiq::Periodic::LoopSet.prepend(Sidekiq::Belt::Ent::PeriodicSort::SidekiqLoopsPeriodicSort)
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
data/lib/sidekiq/belt/version.rb
CHANGED
@@ -14,7 +14,9 @@ module Sidekiq
|
|
14
14
|
|
15
15
|
path_info ||= ::Rack::Utils.unescape(env["PATH_INFO"])
|
16
16
|
|
17
|
-
Sidekiq::Config::DEFAULTS[:replace_views]
|
17
|
+
replace_views = Sidekiq::Config::DEFAULTS[:replace_views] || {}
|
18
|
+
|
19
|
+
replace_views.fetch(path_info.to_s, []).each do |content_block|
|
18
20
|
content_block.call(content)
|
19
21
|
end
|
20
22
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sidekiq-belt
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Danilo Jeremias da Silva
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-02-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sidekiq
|
@@ -45,6 +45,7 @@ files:
|
|
45
45
|
- lib/sidekiq/belt/ent/files.rb
|
46
46
|
- lib/sidekiq/belt/ent/periodic_pause.rb
|
47
47
|
- lib/sidekiq/belt/ent/periodic_run.rb
|
48
|
+
- lib/sidekiq/belt/ent/periodic_sort.rb
|
48
49
|
- lib/sidekiq/belt/pro/failed_batch_remove.rb
|
49
50
|
- lib/sidekiq/belt/pro/files.rb
|
50
51
|
- lib/sidekiq/belt/version.rb
|