UNPKG

@lexamica-modules/job-queue

Version:

The package for the Lexamica Job Queue SDK powered by Redis and BullMQ

24 lines (23 loc) 870 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.checkEnv = void 0; /** * Runs a check of all required environment variables and throws an error if any are missing */ function checkEnv() { const envVars = { // JOB_QUEUE_COMPLETIONS: process.env.JOB_QUEUE_COMPLETIONS, // JOB_QUEUE_FAILURES: process.env.JOB_QUEUE_FAILURES, JOB_QUEUE_ENCRYPTION_KEY: process.env.JOB_QUEUE_ENCRYPTION_KEY, }; const missing = []; for (const [key, value] of Object.entries(envVars)) { if (!value) { missing.push(key); } } if (missing.length > 0) { throw new Error(`The following environment variables have not been configured, or have been configured as null. These environment variables are required: ${JSON.stringify(missing)}`); } } exports.checkEnv = checkEnv;