避免uncache公有云镜像失败

This commit is contained in:
屈轩
2019-03-29 16:45:16 +08:00
committed by Yousong Zhou
parent d694500d5e
commit 4ef8286015
@@ -46,7 +46,7 @@ func (self *StorageUncacheImageTask) OnInit(ctx context.Context, obj db.IStandal
scimg := models.StoragecachedimageManager.Register(ctx, self.UserCred, storageCache.Id, imageId, "")
if scimg == nil || len(scimg.Path) == 0 {
if scimg == nil || (len(scimg.Path) == 0 && len(scimg.ExternalId) == 0) {
// "image is not cached on this storage"
self.OnImageUncacheComplete(ctx, storageCache, nil)
}