sidekiq 7.3.0 → 7.3.2
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 +4 -4
- data/Changes.md +16 -0
- data/lib/generators/sidekiq/job_generator.rb +2 -0
- data/lib/sidekiq/api.rb +9 -3
- data/lib/sidekiq/capsule.rb +2 -0
- data/lib/sidekiq/client.rb +4 -1
- data/lib/sidekiq/config.rb +2 -0
- data/lib/sidekiq/deploy.rb +2 -0
- data/lib/sidekiq/embedded.rb +2 -0
- data/lib/sidekiq/iterable_job.rb +2 -0
- data/lib/sidekiq/job/interrupt_handler.rb +2 -0
- data/lib/sidekiq/job/iterable/active_record_enumerator.rb +3 -3
- data/lib/sidekiq/job_logger.rb +2 -4
- data/lib/sidekiq/job_util.rb +2 -0
- data/lib/sidekiq/metrics/query.rb +2 -0
- data/lib/sidekiq/metrics/shared.rb +2 -0
- data/lib/sidekiq/metrics/tracking.rb +13 -5
- data/lib/sidekiq/middleware/current_attributes.rb +2 -0
- data/lib/sidekiq/middleware/modules.rb +2 -0
- data/lib/sidekiq/monitor.rb +2 -1
- data/lib/sidekiq/redis_connection.rb +8 -1
- data/lib/sidekiq/ring_buffer.rb +2 -0
- data/lib/sidekiq/systemd.rb +2 -0
- data/lib/sidekiq/version.rb +1 -1
- data/lib/sidekiq/web/application.rb +2 -1
- data/lib/sidekiq/web/helpers.rb +1 -1
- data/lib/sidekiq/web.rb +2 -0
- data/web/assets/stylesheets/application.css +4 -8
- data/web/locales/tr.yml +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ce4653de61d5b923ce7556490e95cf6918dd1c94340417ec4093f11cc8ceda39
|
4
|
+
data.tar.gz: e9faa23d4535a5b647c5dc86c28ce64317ea964f44faa9141b5a883f77b80dcd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5fa259f415261689936b4f03f179198ea6849fbe63b932b5836fa800714055ce574a80a56462355a92d125440362957ebf02e5bafbde55fe8211805c80573ae5
|
7
|
+
data.tar.gz: 0aaf341ae13c377e6f944344e0feef246e3450ae9eb0d74fcbf8e932e9c9fcf0d8f0dd56ce374064d4f51c4d99f4c306560c3283db27f70ae6aa5af346d83ec3
|
data/Changes.md
CHANGED
@@ -2,6 +2,22 @@
|
|
2
2
|
|
3
3
|
[Sidekiq Changes](https://github.com/sidekiq/sidekiq/blob/main/Changes.md) | [Sidekiq Pro Changes](https://github.com/sidekiq/sidekiq/blob/main/Pro-Changes.md) | [Sidekiq Enterprise Changes](https://github.com/sidekiq/sidekiq/blob/main/Ent-Changes.md)
|
4
4
|
|
5
|
+
7.3.2
|
6
|
+
----------
|
7
|
+
|
8
|
+
- Adjust ActiveRecord batch iteration to restart an interrupted batch from the beginning.
|
9
|
+
Each batch should be processed as a single transaction in order to be idempotent. [#6405]
|
10
|
+
- Fix typo in S::DeadSet#kill [#6397]
|
11
|
+
- Fix CSS issue with bottom bar in Web UI [#6414]
|
12
|
+
|
13
|
+
7.3.1
|
14
|
+
----------
|
15
|
+
|
16
|
+
- Don't count job interruptions as failures in metrics [#6386]
|
17
|
+
- Add frozen string literal to a number of .rb files.
|
18
|
+
- Fix frozen string error with style_tag and script_tag [#6371]
|
19
|
+
- Fix an error on Ruby 2.7 because of usage of `Hash#except` [#6376]
|
20
|
+
|
5
21
|
7.3.0
|
6
22
|
----------
|
7
23
|
|
data/lib/sidekiq/api.rb
CHANGED
@@ -813,6 +813,8 @@ module Sidekiq
|
|
813
813
|
|
814
814
|
# Add the given job to the Dead set.
|
815
815
|
# @param message [String] the job data as JSON
|
816
|
+
# @option opts [Boolean] :notify_failure (true) Whether death handlers should be called
|
817
|
+
# @option opts [Exception] :ex (RuntimeError) An exception to pass to the death handlers
|
816
818
|
def kill(message, opts = {})
|
817
819
|
now = Time.now.to_f
|
818
820
|
Sidekiq.redis do |conn|
|
@@ -825,10 +827,14 @@ module Sidekiq
|
|
825
827
|
|
826
828
|
if opts[:notify_failure] != false
|
827
829
|
job = Sidekiq.load_json(message)
|
828
|
-
|
829
|
-
|
830
|
+
if opts[:ex]
|
831
|
+
ex = opts[:ex]
|
832
|
+
else
|
833
|
+
ex = RuntimeError.new("Job killed by API")
|
834
|
+
ex.set_backtrace(caller)
|
835
|
+
end
|
830
836
|
Sidekiq.default_configuration.death_handlers.each do |handle|
|
831
|
-
handle.call(job,
|
837
|
+
handle.call(job, ex)
|
832
838
|
end
|
833
839
|
end
|
834
840
|
true
|
data/lib/sidekiq/capsule.rb
CHANGED
data/lib/sidekiq/client.rb
CHANGED
@@ -251,7 +251,10 @@ module Sidekiq
|
|
251
251
|
at = hash["at"].to_s
|
252
252
|
# ActiveJob sets this but the job has not been enqueued yet
|
253
253
|
hash.delete("enqueued_at")
|
254
|
-
|
254
|
+
# TODO: Use hash.except("at") when support for Ruby 2.7 is dropped
|
255
|
+
hash = hash.dup
|
256
|
+
hash.delete("at")
|
257
|
+
[at, Sidekiq.dump_json(hash)]
|
255
258
|
})
|
256
259
|
else
|
257
260
|
queue = payloads.first["queue"]
|
data/lib/sidekiq/config.rb
CHANGED
data/lib/sidekiq/deploy.rb
CHANGED
data/lib/sidekiq/embedded.rb
CHANGED
data/lib/sidekiq/iterable_job.rb
CHANGED
@@ -22,7 +22,7 @@ module Sidekiq
|
|
22
22
|
def batches
|
23
23
|
Enumerator.new(-> { @relation.count }) do |yielder|
|
24
24
|
@relation.find_in_batches(**@options, start: @cursor) do |batch|
|
25
|
-
yielder.yield(batch, batch.
|
25
|
+
yielder.yield(batch, batch.first.id)
|
26
26
|
end
|
27
27
|
end
|
28
28
|
end
|
@@ -35,8 +35,8 @@ module Sidekiq
|
|
35
35
|
options[:of] ||= options.delete(:batch_size)
|
36
36
|
|
37
37
|
@relation.in_batches(**options, start: @cursor) do |relation|
|
38
|
-
|
39
|
-
yielder.yield(relation,
|
38
|
+
first_record = relation.first
|
39
|
+
yielder.yield(relation, first_record.id)
|
40
40
|
end
|
41
41
|
end
|
42
42
|
end
|
data/lib/sidekiq/job_logger.rb
CHANGED
@@ -2,17 +2,15 @@
|
|
2
2
|
|
3
3
|
module Sidekiq
|
4
4
|
class JobLogger
|
5
|
-
include Sidekiq::Component
|
6
|
-
|
7
5
|
def initialize(config)
|
8
6
|
@config = config
|
9
|
-
@logger = logger
|
7
|
+
@logger = @config.logger
|
10
8
|
end
|
11
9
|
|
12
10
|
# If true we won't do any job logging out of the box.
|
13
11
|
# The user is responsible for any logging.
|
14
12
|
def skip_default_logging?
|
15
|
-
config[:skip_default_job_logging]
|
13
|
+
@config[:skip_default_job_logging]
|
16
14
|
end
|
17
15
|
|
18
16
|
def call(item, queue)
|
data/lib/sidekiq/job_util.rb
CHANGED
@@ -31,11 +31,11 @@ module Sidekiq
|
|
31
31
|
# We don't track time for failed jobs as they can have very unpredictable
|
32
32
|
# execution times. more important to know average time for successful jobs so we
|
33
33
|
# can better recognize when a perf regression is introduced.
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
34
|
+
track_time(klass, time_ms)
|
35
|
+
rescue JobRetry::Skip
|
36
|
+
# This is raised when iterable job is interrupted.
|
37
|
+
track_time(klass, time_ms)
|
38
|
+
raise
|
39
39
|
rescue Exception
|
40
40
|
@lock.synchronize {
|
41
41
|
@jobs["#{klass}|f"] += 1
|
@@ -100,6 +100,14 @@ module Sidekiq
|
|
100
100
|
|
101
101
|
private
|
102
102
|
|
103
|
+
def track_time(klass, time_ms)
|
104
|
+
@lock.synchronize {
|
105
|
+
@grams[klass].record_time(time_ms)
|
106
|
+
@jobs["#{klass}|ms"] += time_ms
|
107
|
+
@totals["ms"] += time_ms
|
108
|
+
}
|
109
|
+
end
|
110
|
+
|
103
111
|
def reset
|
104
112
|
@lock.synchronize {
|
105
113
|
array = [@totals, @jobs, @grams]
|
data/lib/sidekiq/monitor.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
2
3
|
|
3
4
|
require "fileutils"
|
4
5
|
require "sidekiq/api"
|
@@ -98,7 +99,7 @@ class Sidekiq::Monitor
|
|
98
99
|
pad = opts[:pad] || 0
|
99
100
|
max_length = opts[:max_length] || (80 - pad)
|
100
101
|
out = []
|
101
|
-
line = ""
|
102
|
+
line = +""
|
102
103
|
values.each do |value|
|
103
104
|
if (line.length + value.length) > max_length
|
104
105
|
out << line
|
@@ -66,7 +66,14 @@ module Sidekiq
|
|
66
66
|
scrubbed_options[:password] = redacted if scrubbed_options[:password]
|
67
67
|
scrubbed_options[:sentinel_password] = redacted if scrubbed_options[:sentinel_password]
|
68
68
|
scrubbed_options[:sentinels]&.each do |sentinel|
|
69
|
-
|
69
|
+
if sentinel.is_a?(String)
|
70
|
+
if (uri = URI(sentinel)) && uri.password
|
71
|
+
uri.password = redacted
|
72
|
+
sentinel.replace(uri.to_s)
|
73
|
+
end
|
74
|
+
elsif sentinel[:password]
|
75
|
+
sentinel[:password] = redacted
|
76
|
+
end
|
70
77
|
end
|
71
78
|
scrubbed_options
|
72
79
|
end
|
data/lib/sidekiq/ring_buffer.rb
CHANGED
data/lib/sidekiq/systemd.rb
CHANGED
data/lib/sidekiq/version.rb
CHANGED
@@ -428,7 +428,8 @@ module Sidekiq
|
|
428
428
|
Rack::CONTENT_TYPE => "text/html",
|
429
429
|
Rack::CACHE_CONTROL => "private, no-store",
|
430
430
|
Web::CONTENT_LANGUAGE => action.locale,
|
431
|
-
Web::CONTENT_SECURITY_POLICY => process_csp(env, CSP_HEADER_TEMPLATE)
|
431
|
+
Web::CONTENT_SECURITY_POLICY => process_csp(env, CSP_HEADER_TEMPLATE),
|
432
|
+
Web::X_CONTENT_TYPE_OPTIONS => "nosniff"
|
432
433
|
}
|
433
434
|
# we'll let Rack calculate Content-Length for us.
|
434
435
|
[200, headers, [resp]]
|
data/lib/sidekiq/web/helpers.rb
CHANGED
data/lib/sidekiq/web.rb
CHANGED
@@ -40,11 +40,13 @@ module Sidekiq
|
|
40
40
|
CONTENT_SECURITY_POLICY = "Content-Security-Policy"
|
41
41
|
LOCATION = "Location"
|
42
42
|
X_CASCADE = "X-Cascade"
|
43
|
+
X_CONTENT_TYPE_OPTIONS = "X-Content-Type-Options"
|
43
44
|
else
|
44
45
|
CONTENT_LANGUAGE = "content-language"
|
45
46
|
CONTENT_SECURITY_POLICY = "content-security-policy"
|
46
47
|
LOCATION = "location"
|
47
48
|
X_CASCADE = "x-cascade"
|
49
|
+
X_CONTENT_TYPE_OPTIONS = "x-content-type-options"
|
48
50
|
end
|
49
51
|
|
50
52
|
class << self
|
@@ -634,12 +634,8 @@ div.interval-slider input {
|
|
634
634
|
.container {
|
635
635
|
padding: 0;
|
636
636
|
}
|
637
|
-
.navbar-fixed-bottom {
|
638
|
-
position: relative;
|
639
|
-
top: auto;
|
640
|
-
}
|
641
637
|
@media (max-width: 767px) {
|
642
|
-
.navbar-fixed-top {
|
638
|
+
.navbar-fixed-top, .navbar-fixed-bottom {
|
643
639
|
position: relative;
|
644
640
|
top: auto;
|
645
641
|
}
|
@@ -652,18 +648,18 @@ div.interval-slider input {
|
|
652
648
|
|
653
649
|
@media (min-width: 768px) {
|
654
650
|
.redis-url {
|
655
|
-
max-width:
|
651
|
+
max-width: 160px;
|
656
652
|
}
|
657
653
|
}
|
658
654
|
|
659
655
|
@media (min-width: 992px) {
|
660
656
|
.redis-url {
|
661
|
-
max-width:
|
657
|
+
max-width: 380px;
|
662
658
|
}
|
663
659
|
}
|
664
660
|
@media (min-width: 1200px) {
|
665
661
|
.redis-url {
|
666
|
-
max-width:
|
662
|
+
max-width: 580px;
|
667
663
|
}
|
668
664
|
}
|
669
665
|
|
data/web/locales/tr.yml
CHANGED
@@ -4,7 +4,7 @@ tr:
|
|
4
4
|
AddToQueue: Kuyruğa ekle
|
5
5
|
AreYouSure: Emin misiniz?
|
6
6
|
AreYouSureDeleteJob: Bu işi silmek istediğinizden emin misiniz?
|
7
|
-
AreYouSureDeleteQueue: %{queue} kuyruğunu silmek istediğinizden emin misiniz?
|
7
|
+
AreYouSureDeleteQueue: "%{queue} kuyruğunu silmek istediğinizden emin misiniz?"
|
8
8
|
Arguments: Argümanlar
|
9
9
|
BackToApp: Uygulamaya geri dön
|
10
10
|
Busy: Meşgul
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sidekiq
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 7.3.
|
4
|
+
version: 7.3.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mike Perham
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-09-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: redis-client
|