UNPKG

n8n

Version:

n8n Workflow Automation Tool

35 lines 1.66 kB
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.getWorkflowHistoryPruneTime = exports.getWorkflowHistoryLicensePruneTime = exports.isWorkflowHistoryEnabled = exports.isWorkflowHistoryLicensed = void 0; 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(); } exports.isWorkflowHistoryLicensed = isWorkflowHistoryLicensed; function isWorkflowHistoryEnabled() { return isWorkflowHistoryLicensed() && config_1.default.getEnv('workflowHistory.enabled'); } exports.isWorkflowHistoryEnabled = isWorkflowHistoryEnabled; function getWorkflowHistoryLicensePruneTime() { return typedi_1.default.get(License_1.License).getWorkflowHistoryPruneLimit(); } exports.getWorkflowHistoryLicensePruneTime = getWorkflowHistoryLicensePruneTime; 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); } exports.getWorkflowHistoryPruneTime = getWorkflowHistoryPruneTime; //# sourceMappingURL=workflowHistoryHelper.ee.js.map