fix: cloud provider sync time is not set in auto-sync cycles

This commit is contained in:
Qiu Jian
2019-03-16 21:23:43 +08:00
parent 0eb7d4ca07
commit 6fa0e254ef
+6
View File
@@ -867,6 +867,9 @@ func (provider *SCloudprovider) GetEnabledCloudproviderRegions() []SCloudprovide
}
func (provider *SCloudprovider) syncCloudproviderRegions(userCred mcclient.TokenCredential, syncRange *SSyncRange, wg *sync.WaitGroup) {
if wg == nil {
provider.MarkSyncing(userCred)
}
cprs := provider.GetEnabledCloudproviderRegions()
for i := range cprs {
if cprs[i].needSync() {
@@ -882,6 +885,9 @@ func (provider *SCloudprovider) syncCloudproviderRegions(userCred mcclient.Token
}
}
}
if wg == nil {
provider.MarkEndSync(userCred)
}
}
func (provider *SCloudprovider) SyncCallSyncCloudproviderRegions(userCred mcclient.TokenCredential, syncRange *SSyncRange) {