fix: avoid host worker is locked when image cache is deleted

This commit is contained in:
Qu Xuan
2021-04-27 20:37:06 +08:00
parent 5788704501
commit b13cdefb72
@@ -205,6 +205,10 @@ func (l *SLocalImageCache) fetch(ctx context.Context, zone, srcUrl, format strin
defer l.cond.L.Unlock()
l.Desc = l.remoteFile.GetInfo()
if l.Desc == nil {
l.remoteFile = nil
return false
}
l.Size = l.GetSize() / 1024 / 1024
l.Desc.Id = l.imageId
l.remoteFile = nil