Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
71064f67
Commit
71064f67
authored
Sep 29, 2020
by
Igor
Committed by
Jacob Vosmaer
Sep 29, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Pass CORRELATION_ID env variable to resize image subprocesses
parent
5a2a990f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
0 deletions
+8
-0
changelogs/unreleased/image-resizer-correlation-id.yml
changelogs/unreleased/image-resizer-correlation-id.yml
+5
-0
internal/imageresizer/image_resizer.go
internal/imageresizer/image_resizer.go
+3
-0
No files found.
changelogs/unreleased/image-resizer-correlation-id.yml
0 → 100644
View file @
71064f67
---
title
:
Pass CORRELATION_ID env variable to resize image subprocesses
merge_request
:
612
author
:
type
:
other
internal/imageresizer/image_resizer.go
View file @
71064f67
...
...
@@ -46,6 +46,8 @@ const (
maxAllowedFileSizeBytes
=
250
*
1000
// 250kB
)
var
envInjector
=
tracing
.
NewEnvInjector
()
// Images might be located remotely in object storage, in which case we need to stream
// it via http(s)
var
httpTransport
=
tracing
.
NewRoundTripper
(
correlation
.
NewInstrumentedRoundTripper
(
&
http
.
Transport
{
...
...
@@ -218,6 +220,7 @@ func startResizeImageCommand(ctx context.Context, imageReader io.Reader, errorWr
"GL_RESIZE_IMAGE_WIDTH="
+
strconv
.
Itoa
(
int
(
params
.
Width
)),
"GL_RESIZE_IMAGE_CONTENT_TYPE="
+
params
.
ContentType
,
}
cmd
.
Env
=
envInjector
(
ctx
,
cmd
.
Env
)
stdout
,
err
:=
cmd
.
StdoutPipe
()
if
err
!=
nil
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment