Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
matrix-media-repo
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Service Desk
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TeDomum
matrix-media-repo
Commits
b1c27b58
Commit
b1c27b58
authored
1 year ago
by
Travis Ralston
Browse files
Options
Downloads
Patches
Plain Diff
Don't calculate blurhashes when we're not supposed to
parent
e8e2f540
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
pipline/_steps/upload/blurhash_async.go
+7
-3
7 additions, 3 deletions
pipline/_steps/upload/blurhash_async.go
with
7 additions
and
3 deletions
pipline/_steps/upload/blurhash_async.go
+
7
−
3
View file @
b1c27b58
...
...
@@ -12,11 +12,15 @@ import (
func
CalculateBlurhashAsync
(
ctx
rcontext
.
RequestContext
,
reader
io
.
Reader
,
sha256hash
string
)
chan
struct
{}
{
var
err
error
bh
Chan
:=
make
(
chan
struct
{})
op
Chan
:=
make
(
chan
struct
{})
go
func
()
{
//goland:noinspection GoUnhandledErrorResult
defer
io
.
Copy
(
io
.
Discard
,
reader
)
// we need to flush the reader as we might end up blocking the upload
defer
close
(
bhChan
)
defer
close
(
opChan
)
if
!
ctx
.
Config
.
Features
.
MSC2448Blurhash
.
Enabled
{
return
}
var
img
image
.
Image
img
,
err
=
imaging
.
Decode
(
reader
)
...
...
@@ -43,5 +47,5 @@ func CalculateBlurhashAsync(ctx rcontext.RequestContext, reader io.Reader, sha25
return
}
}()
return
bh
Chan
return
op
Chan
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment