mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-24 16:03:43 +08:00
Merge pull request #2630 from ioito/hotfix/qx-change-config-pending-usage
fix: avoid not release pending-usage
This commit is contained in:
@@ -179,6 +179,9 @@ func (self *GuestChangeConfigTask) OnGuestChangeCpuMemSpecComplete(ctx context.C
|
||||
}
|
||||
}
|
||||
|
||||
addCpu := int(vcpuCount - int64(guest.VcpuCount))
|
||||
addMem := int(vmemSize - int64(guest.VmemSize))
|
||||
|
||||
_, err := db.Update(guest, func() error {
|
||||
if vcpuCount > 0 {
|
||||
guest.VcpuCount = int(vcpuCount)
|
||||
@@ -203,8 +206,6 @@ func (self *GuestChangeConfigTask) OnGuestChangeCpuMemSpecComplete(ctx context.C
|
||||
return
|
||||
}
|
||||
var cancelUsage models.SQuota
|
||||
addCpu := int(vcpuCount - int64(guest.VcpuCount))
|
||||
addMem := int(vmemSize - int64(guest.VmemSize))
|
||||
if addCpu > 0 {
|
||||
cancelUsage.Cpu = addCpu
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user