Skip to content

Commit

Permalink
fix concurrency limit setting
Browse files Browse the repository at this point in the history
  • Loading branch information
logica0419 committed Dec 10, 2023
1 parent 662751b commit 4302fa8
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions service/imaging/processor_default.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ func (p *defaultProcessor) FitAnimationGIF(src io.Reader, width, height int) (*b

// destImage.ImageのためのMutex
distImageMutex := sync.Mutex{}
eg, ctx := errgroup.WithContext(context.Background())
eg, _ := errgroup.WithContext(context.Background())

// 拡縮用のGoRoutineを先に生成
for i := range srcImage.Image {
Expand All @@ -141,11 +141,6 @@ func (p *defaultProcessor) FitAnimationGIF(src io.Reader, width, height int) (*b
// フレームのデータを受け取った瞬間に稼働
imageData := <-frameDataChannels[i]

if err := p.sp.Acquire(ctx, 1); err != nil {
return err
}
defer p.sp.Release(1)

// 重ねたフレームを縮小
fittedImage := imaging.Resize(imageData.tempCanvas, width, height, mks2013Filter)

Expand Down

0 comments on commit 4302fa8

Please sign in to comment.