fix(region): add disk change billing type log (#23232)

This commit is contained in:
屈轩
2025-09-03 20:16:38 +08:00
committed by GitHub
parent 56825a3cd9
commit 9ea05affbf
@@ -243,15 +243,15 @@ func (self *ManagedGuestCreateDiskTask) OnManagedDiskPrepared(ctx context.Contex
return
}
time.Sleep(time.Second * 5)
time.Sleep(time.Second * 10)
log.Debugf("guest %s(%s) billing type: %s disk %s(%s)", guest.Name, guest.Id, guest.BillingType, disk.Name, disk.Id)
if guest.BillingType == billing_api.BILLING_TYPE_PREPAID {
idisk, err := disk.GetIDisk(ctx)
if err != nil {
if errors.Cause(err) != cloudprovider.ErrNotFound {
logclient.AddActionLogWithStartable(self, guest, logclient.ACT_CHANGE_BILLING_TYPE, errors.Wrapf(err, "GetIDisk %s", disk.ExternalId), self.UserCred, false)
continue
}
logclient.AddActionLogWithStartable(self, guest, logclient.ACT_CHANGE_BILLING_TYPE, errors.Wrapf(err, "GetIDisk %s", disk.ExternalId), self.UserCred, false)
continue
}
err = idisk.ChangeBillingType(guest.BillingType)
if err != nil {