فهرست منبع

Properly handle quota nightly task error

Toby Chui 1 روز پیش
والد
کامیت
df3642f634
1فایلهای تغییر یافته به همراه6 افزوده شده و 1 حذف شده
  1. 6 1
      src/quota.go

+ 6 - 1
src/quota.go

@@ -38,7 +38,12 @@ func system_disk_quota_updateAllUserQuotaEstimation() {
 	registeredUsers := authAgent.ListUsers()
 	for _, username := range registeredUsers {
 		//For each user, update their current quota usage
-		userinfo, _ := userHandler.GetUserInfoFromUsername(username)
+		userinfo, err := userHandler.GetUserInfoFromUsername(username)
+		if err != nil {
+			//A listed name that cannot be loaded has no quota handler
+			systemWideLogger.PrintAndLog("Quota", "Skipping quota update for user "+strconv.Quote(username), err)
+			continue
+		}
 		userinfo.StorageQuota.CalculateQuotaUsage()
 	}
 }