From c5047babca52b305e6faf27ec82573b8472cf3d8 Mon Sep 17 00:00:00 2001 From: Zoe Roux Date: Thu, 25 Jul 2024 19:22:04 +0200 Subject: [PATCH] Cleanup file stream cache --- transcoder/src/transcoder.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/transcoder/src/transcoder.go b/transcoder/src/transcoder.go index 1dffecb6..983e31a9 100644 --- a/transcoder/src/transcoder.go +++ b/transcoder/src/transcoder.go @@ -34,12 +34,11 @@ func NewTranscoder() (*Transcoder, error) { } func (t *Transcoder) getFileStream(path string, sha string) (*FileStream, error) { - var err error - ret, _ := t.streams.GetOrCreate(path, func() *FileStream { + ret, _ := t.streams.GetOrCreate(sha, func() *FileStream { return NewFileStream(path, sha) }) ret.ready.Wait() - if err != nil || ret.err != nil { + if ret.err != nil { t.streams.Remove(path) return nil, ret.err }