fix: don't throw error while fetching orgname (#4496)

* fix: don't throw error while fetching orgname

* fix: don't ignore the error
This commit is contained in:
Nityananda Gohain 2024-02-05 20:23:20 +05:30 committed by GitHub
parent 9d689693b4
commit 554c4332c4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -139,17 +139,13 @@ func (lm *Manager) UploadUsage() {
zap.S().Info("uploading usage data") zap.S().Info("uploading usage data")
// Try to get the org name
orgName := "" orgName := ""
orgNames, err := lm.modelDao.GetOrgs(ctx) orgNames, orgError := lm.modelDao.GetOrgs(ctx)
if err != nil { if orgError != nil {
zap.S().Errorf("failed to get org data: %v", zap.Error(err)) zap.S().Errorf("failed to get org data: %v", zap.Error(orgError))
} else { }
if len(orgNames) != 1 { if len(orgNames) == 1 {
zap.S().Errorf("expected one org but got %d orgs", len(orgNames)) orgName = orgNames[0].Name
} else {
orgName = orgNames[0].Name
}
} }
usagesPayload := []model.Usage{} usagesPayload := []model.Usage{}