mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-09-22 13:39:35 +00:00
Add flag to throw on syncLicenseKeyOnPremFeatures for the initial bootstrap
This commit is contained in:
@@ -86,7 +86,7 @@ export const licenseServiceFactory = ({
|
|||||||
appCfg.LICENSE_KEY || ""
|
appCfg.LICENSE_KEY || ""
|
||||||
);
|
);
|
||||||
|
|
||||||
const syncLicenseKeyOnPremFeatures = async () => {
|
const syncLicenseKeyOnPremFeatures = async (shouldThrow: boolean = false) => {
|
||||||
try {
|
try {
|
||||||
const {
|
const {
|
||||||
data: { currentPlan }
|
data: { currentPlan }
|
||||||
@@ -94,6 +94,7 @@ export const licenseServiceFactory = ({
|
|||||||
onPremFeatures = currentPlan;
|
onPremFeatures = currentPlan;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
logger.error(error, "Failed to synchronize license key features");
|
logger.error(error, "Failed to synchronize license key features");
|
||||||
|
if (shouldThrow) throw error;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -110,7 +111,7 @@ export const licenseServiceFactory = ({
|
|||||||
if (appCfg.LICENSE_KEY) {
|
if (appCfg.LICENSE_KEY) {
|
||||||
const token = await licenseServerOnPremApi.refreshLicense();
|
const token = await licenseServerOnPremApi.refreshLicense();
|
||||||
if (token) {
|
if (token) {
|
||||||
await syncLicenseKeyOnPremFeatures();
|
await syncLicenseKeyOnPremFeatures(true);
|
||||||
instanceType = InstanceType.EnterpriseOnPrem;
|
instanceType = InstanceType.EnterpriseOnPrem;
|
||||||
logger.info(`Instance type: ${InstanceType.EnterpriseOnPrem}`);
|
logger.info(`Instance type: ${InstanceType.EnterpriseOnPrem}`);
|
||||||
isValidLicense = true;
|
isValidLicense = true;
|
||||||
|
|||||||
Reference in New Issue
Block a user