Fix gallery zip scan context (#3433)

* fix zip scan context
* move ValueOnlyContext to utils, use it for zipCtx
This commit is contained in:
xWTF
2023-02-16 07:07:52 +08:00
committed by GitHub
parent d00966c335
commit 6a5a2060bf
4 changed files with 26 additions and 24 deletions

View File

@@ -14,6 +14,7 @@ import (
"github.com/remeh/sizedwaitgroup"
"github.com/stashapp/stash/pkg/logger"
"github.com/stashapp/stash/pkg/txn"
"github.com/stashapp/stash/pkg/utils"
)
const (
@@ -574,7 +575,7 @@ func (s *scanJob) handleFile(ctx context.Context, f scanFile) error {
// scan zip files with a different context that is not cancellable
// cancelling while scanning zip file contents results in the scan
// contents being partially completed
zipCtx := context.Background()
zipCtx := utils.ValueOnlyContext{Context: ctx}
if err := s.scanZipFile(zipCtx, f); err != nil {
logger.Errorf("Error scanning zip file %q: %v", f.Path, err)