Unverified Commit 64f7e3bc authored by Wenkai Yin(尹文开)'s avatar Wenkai Yin(尹文开) Committed by GitHub
Browse files

Merge pull request #9364 from wy65701436/fix-migration-rerun

fix quota migration still execute on launch even data sync success
parents 28251c7b 8c155e0c
......@@ -85,14 +85,19 @@ func updateInitPassword(userID int, password string) error {
// Quota migration
func quotaSync() error {
usages, err := dao.ListQuotaUsages()
projects, err := dao.GetProjects(nil)
if err != nil {
log.Errorf("list quota usage error, %v", err)
log.Errorf("list project error, %v", err)
return err
}
projects, err := dao.GetProjects(nil)
var pids []string
for _, project := range projects {
pids = append(pids, strconv.FormatInt(project.ProjectID, 10))
}
usages, err := dao.ListQuotaUsages(&models.QuotaUsageQuery{Reference: "project", ReferenceIDs: pids})
if err != nil {
log.Errorf("list project error, %v", err)
log.Errorf("list quota usage error, %v", err)
return err
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment