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
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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 image != nil {
if err := image.LoadPrimaryFile(ctx, rs.fileFinder); err != 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 // set image to nil so that it doesn't try to use the primary file
image = nil image = nil
} }

View File

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