Skip to content

Commit

Permalink
chore: make the init only if the licenses v2 is present
Browse files Browse the repository at this point in the history
  • Loading branch information
vikrantgupta25 committed Nov 18, 2024
1 parent 1d4d42f commit a75b4f8
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions ee/query-service/license/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,16 +74,19 @@ func StartManager(dbType string, db *sqlx.DB, useLicensesV3 bool, features ...ba
return m, err
}

// fetch the new license structure from control plane
licenseV3, apiError := validate.ValidateLicenseV3(active.Key)
if apiError != nil {
return m, apiError
}
// if we have an active license then need to fetch the complete details
if active != nil {
// fetch the new license structure from control plane
licenseV3, apiError := validate.ValidateLicenseV3(active.Key)
if apiError != nil {
return m, apiError
}

// insert the licenseV3 in sqlite db
apiError = m.repo.InsertLicenseV3(context.Background(), licenseV3)
if apiError != nil {
return m, apiError
// insert the licenseV3 in sqlite db
apiError = m.repo.InsertLicenseV3(context.Background(), licenseV3)
if apiError != nil {
return m, apiError
}
}
}

Expand Down

0 comments on commit a75b4f8

Please sign in to comment.