n8n
Version:
n8n Workflow Automation Tool
34 lines • 1.5 kB
JavaScript
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.isWorkflowHistoryLicensed = isWorkflowHistoryLicensed;
exports.isWorkflowHistoryEnabled = isWorkflowHistoryEnabled;
exports.getWorkflowHistoryLicensePruneTime = getWorkflowHistoryLicensePruneTime;
exports.getWorkflowHistoryPruneTime = getWorkflowHistoryPruneTime;
const License_1 = require("../../License");
const config_1 = __importDefault(require("../../config"));
const typedi_1 = __importDefault(require("typedi"));
function isWorkflowHistoryLicensed() {
const license = typedi_1.default.get(License_1.License);
return license.isWorkflowHistoryLicensed();
}
function isWorkflowHistoryEnabled() {
return isWorkflowHistoryLicensed() && config_1.default.getEnv('workflowHistory.enabled');
}
function getWorkflowHistoryLicensePruneTime() {
return typedi_1.default.get(License_1.License).getWorkflowHistoryPruneLimit();
}
function getWorkflowHistoryPruneTime() {
const licenseTime = typedi_1.default.get(License_1.License).getWorkflowHistoryPruneLimit();
const configTime = config_1.default.getEnv('workflowHistory.pruneTime');
if (licenseTime === -1) {
return configTime;
}
if (configTime === -1) {
return licenseTime;
}
return Math.min(configTime, licenseTime);
}
//# sourceMappingURL=workflowHistoryHelper.ee.js.map
;