gitlab-labkit 0.35.0 → 0.35.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/labkit/context.rb +0 -4
- data/lib/labkit/middleware/sidekiq/context/client.rb +9 -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: 48e2df6dd68eddc3928dad7c12f616bc124c16c55fd3d94947a21f23dc9cd732
|
4
|
+
data.tar.gz: 4b7dd6dffbb2936d6464b5777ac01db0c2142cdfa79b0527419a3750fcbe6b60
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f7eea840bb4724fedc0f0789d87f234a4f997dce9cdefece2ea839c09c4c0a6a2494f80048d8fbb9dcd0545e1ec4fca0e1600fb528bbeffd6369458868ebb94c
|
7
|
+
data.tar.gz: d2274b20b41924ed939e2f09d9ae0dcefbdcfff8bed448d8c045373c1afa72785f2a9e528036e535460807cd59532f4d5eb96b45949abea24eb33b9de6ca15ca
|
data/lib/labkit/context.rb
CHANGED
@@ -9,7 +9,15 @@ module Labkit
|
|
9
9
|
# be reinstantiated by Sidekiq-server when running the job.
|
10
10
|
class Client
|
11
11
|
def call(_worker_class, job, _queue, _redis_pool)
|
12
|
-
|
12
|
+
attributes = {}
|
13
|
+
|
14
|
+
# Don't overwrite the correlation_id from the job. A new context
|
15
|
+
# will always generate a new correlation_id and we'd rather carry
|
16
|
+
# through the correlation_id from the previous job if it is
|
17
|
+
# present (eg. for retries).
|
18
|
+
attributes[Labkit::Context::CORRELATION_ID_KEY] = job["correlation_id"] if job["correlation_id"]
|
19
|
+
|
20
|
+
Labkit::Context.with_context(attributes) do |context|
|
13
21
|
job.merge!(context.to_h)
|
14
22
|
|
15
23
|
yield
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gitlab-labkit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.35.
|
4
|
+
version: 0.35.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrew Newdigate
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-02-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: actionpack
|