cursor cache disable if not available.

This commit is contained in:
Miroslav Šedivý 2021-02-28 18:52:37 +01:00
parent 663270b0f5
commit 2204400282

View File

@ -60,6 +60,11 @@ func (manager *ImageCtx) Shutdown() {
} }
func (manager *ImageCtx) GetCached(serial uint64) (*ImageEntry, error) { func (manager *ImageCtx) GetCached(serial uint64) (*ImageEntry, error) {
// zero means no serial available
if serial == 0 {
return manager.fetchEntry()
}
manager.cacheMu.Lock() manager.cacheMu.Lock()
entry, ok := manager.cache[serial] entry, ok := manager.cache[serial]
manager.cacheMu.Unlock() manager.cacheMu.Unlock()