mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-06-02 05:52:00 +08:00
修复不支持redis的公有云账号会频繁读取oss数据的问题
This commit is contained in:
@@ -127,14 +127,16 @@ func syncRegionSkus(ctx context.Context, userCred mcclient.TokenCredential, loca
|
||||
}
|
||||
}
|
||||
|
||||
cnt, err = ElasticcacheSkuManager.GetSkuCountByRegion(regionId)
|
||||
if err != nil {
|
||||
log.Errorf("ElasticcacheSkuManager.GetSkuCountByRegion fail %s", err)
|
||||
return
|
||||
}
|
||||
if localRegion.GetDriver().IsSupportedElasticcache() {
|
||||
cnt, err = ElasticcacheSkuManager.GetSkuCountByRegion(regionId)
|
||||
if err != nil {
|
||||
log.Errorf("ElasticcacheSkuManager.GetSkuCountByRegion fail %s", err)
|
||||
return
|
||||
}
|
||||
|
||||
if cnt == 0 {
|
||||
syncElasticCacheSkusByRegion(ctx, userCred, localRegion)
|
||||
if cnt == 0 {
|
||||
syncElasticCacheSkusByRegion(ctx, userCred, localRegion)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -142,6 +142,7 @@ type IRegionDriver interface {
|
||||
}
|
||||
|
||||
type IElasticcacheDriver interface {
|
||||
IsSupportedElasticcache() bool
|
||||
AllowCreateElasticcacheBackup(ctx context.Context, userCred mcclient.TokenCredential, ownerId mcclient.IIdentityProvider, elasticcache *SElasticcache) error
|
||||
AllowUpdateElasticcacheAuthMode(ctx context.Context, userCred mcclient.TokenCredential, ownerId mcclient.IIdentityProvider, elasticcache *SElasticcache) error
|
||||
ValidateCreateElasticcacheData(ctx context.Context, userCred mcclient.TokenCredential, ownerId mcclient.IIdentityProvider, data *jsonutils.JSONDict) (*jsonutils.JSONDict, error)
|
||||
|
||||
@@ -1535,3 +1535,7 @@ func (self *SAliyunRegionDriver) RequestElasticcacheAccountResetPassword(ctx con
|
||||
|
||||
return ea.SyncWithCloudElasticcacheAccount(ctx, userCred, iea)
|
||||
}
|
||||
|
||||
func (self *SAliyunRegionDriver) IsSupportedElasticcache() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
@@ -294,3 +294,7 @@ func (self *SBaseRegionDriver) ValidateResetDBInstancePassword(ctx context.Conte
|
||||
func (self *SBaseRegionDriver) IsSupportKeepDBInstanceManualBackup() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
func (self *SBaseRegionDriver) IsSupportedElasticcache() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
@@ -2562,3 +2562,7 @@ func (self *SHuaWeiRegionDriver) AllowCreateElasticcacheBackup(ctx context.Conte
|
||||
func (self *SHuaWeiRegionDriver) AllowUpdateElasticcacheAuthMode(ctx context.Context, userCred mcclient.TokenCredential, ownerId mcclient.IIdentityProvider, elasticcache *models.SElasticcache) error {
|
||||
return fmt.Errorf("not support update huawei elastic cache auth_mode")
|
||||
}
|
||||
|
||||
func (self *SHuaWeiRegionDriver) IsSupportedElasticcache() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user