mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-24 16:03:43 +08:00
修改超售比后立即刷新调度缓存
This commit is contained in:
@@ -137,6 +137,19 @@ func (self *SStorage) AllowUpdateItem(ctx context.Context, userCred mcclient.Tok
|
||||
return db.IsAdminAllowUpdate(userCred, self)
|
||||
}
|
||||
|
||||
func (self *SStorage) PostUpdate(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, data jsonutils.JSONObject) {
|
||||
self.SEnabledStatusStandaloneResourceBase.PostUpdate(ctx, userCred, query, data)
|
||||
|
||||
if data.Contains("cmtbound") {
|
||||
hosts := self.GetAttachedHosts()
|
||||
for _, host := range hosts {
|
||||
if err := host.ClearSchedDescCache(); err != nil {
|
||||
log.Errorf("clear host %s sched cache failed %v", host.GetName(), err)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func (self *SStorage) AllowDeleteItem(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, data jsonutils.JSONObject) bool {
|
||||
return db.IsAdminAllowDelete(userCred, self)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user