Skip to content

Commit

Permalink
feat: use the license v2 key to fill licenses v3 on startup
Browse files Browse the repository at this point in the history
  • Loading branch information
vikrantgupta25 committed Nov 18, 2024
1 parent a59e7b9 commit 1d4d42f
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions ee/query-service/license/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,26 @@ func StartManager(dbType string, db *sqlx.DB, useLicensesV3 bool, features ...ba
repo: &repo,
}

if useLicensesV3 {
// get active license from the db
active, err := m.repo.GetActiveLicense(context.Background())
if err != nil {
return m, err
}

// 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
}
}

if err := m.start(useLicensesV3, features...); err != nil {
return m, err
}
Expand Down

0 comments on commit 1d4d42f

Please sign in to comment.