1
0
mirror of https://github.com/imgproxy/imgproxy.git synced 2025-11-29 23:07:40 +02:00

Better error metrics

This commit is contained in:
DarthSim
2022-07-20 15:49:05 +06:00
parent 1524a0e973
commit 20039f49a5
8 changed files with 95 additions and 73 deletions

View File

@@ -53,7 +53,10 @@ func (p pipeline) Run(ctx context.Context, img *vips.Image, po *options.Processi
if err := step(&pctx, img, po, imgdata); err != nil {
return err
}
router.CheckTimeout(ctx)
if err := router.CheckTimeout(ctx); err != nil {
return err
}
}
return nil

View File

@@ -214,7 +214,9 @@ func saveImageToFitBytes(ctx context.Context, po *options.ProcessingOptions, img
}
imgdata.Close()
router.CheckTimeout(ctx)
if err := router.CheckTimeout(ctx); err != nil {
return nil, err
}
delta := float64(len(imgdata.Data)) / float64(po.MaxBytes)
switch {