mirror of
https://github.com/zoriya/Kyoo.git
synced 2025-05-31 20:24:27 -04:00
Cleanup file stream cache
This commit is contained in:
parent
f16fa9686c
commit
c5047babca
@ -34,12 +34,11 @@ func NewTranscoder() (*Transcoder, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (t *Transcoder) getFileStream(path string, sha string) (*FileStream, error) {
|
func (t *Transcoder) getFileStream(path string, sha string) (*FileStream, error) {
|
||||||
var err error
|
ret, _ := t.streams.GetOrCreate(sha, func() *FileStream {
|
||||||
ret, _ := t.streams.GetOrCreate(path, func() *FileStream {
|
|
||||||
return NewFileStream(path, sha)
|
return NewFileStream(path, sha)
|
||||||
})
|
})
|
||||||
ret.ready.Wait()
|
ret.ready.Wait()
|
||||||
if err != nil || ret.err != nil {
|
if ret.err != nil {
|
||||||
t.streams.Remove(path)
|
t.streams.Remove(path)
|
||||||
return nil, ret.err
|
return nil, ret.err
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user