Suppress new context closed errors (#2947)

This commit is contained in:
DingDongSoLong4
2022-09-26 03:41:28 +02:00
committed by GitHub
parent d4e706daef
commit 00820a8789
2 changed files with 6 additions and 2 deletions

View File

@@ -128,7 +128,9 @@ func (rs imageRoutes) ImageCtx(next http.Handler) http.Handler {
if image != nil {
if err := image.LoadPrimaryFile(ctx, rs.fileFinder); err != nil {
logger.Errorf("error loading primary file for image %d: %v", imageID, err)
if !errors.Is(err, context.Canceled) {
logger.Errorf("error loading primary file for image %d: %v", imageID, err)
}
// set image to nil so that it doesn't try to use the primary file
image = nil
}