mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-24 16:03:43 +08:00
fix(region): mark cachedimage deleted (#14692)
This commit is contained in:
@@ -881,8 +881,11 @@ func (manager *SCachedimageManager) AutoCleanImageCaches(ctx context.Context, us
|
||||
caches[i].Delete(ctx, userCred)
|
||||
continue
|
||||
}
|
||||
deleteMark := "-deleted@"
|
||||
db.Update(&caches[i], func() error {
|
||||
caches[i].Name = fmt.Sprintf("%s-deleted@%s", caches[i].Name, timeutils.ShortDate(time.Now()))
|
||||
if !strings.Contains(caches[i].Name, deleteMark) {
|
||||
caches[i].Name = fmt.Sprintf("%s%s%s", caches[i].Name, deleteMark, timeutils.ShortDate(time.Now()))
|
||||
}
|
||||
return nil
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user