Skip to content

Commit

Permalink
add environment variable check
Browse files Browse the repository at this point in the history
  • Loading branch information
unlikelyzero committed Oct 16, 2024
1 parent ccf7ed9 commit d8c5095
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/plugins/persistence/couch/scripts/lockObjects.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,15 @@ import http from 'http';
import nano from 'nano';
import { parseArgs } from 'util';

const COUCH_URL = process.env.OPENMCT_COUCH_URL || 'http://127.0.0.1:5984';
const COUCH_DB_NAME = process.env.OPENMCT_DATABASE_NAME || 'openmct';
const COUCH_URL = process.env.OPENMCT_COUCH_URL;
const COUCH_DB_NAME = process.env.OPENMCT_DATABASE_NAME;

if (!COUCH_URL || !COUCH_DB_NAME) {
console.error(
'Error: Environment variables OPENMCT_COUCH_URL and OPENMCT_DATABASE_NAME must be set.'
);
process.exit(1);
}

const {
values: { couchUrl, database, lock, unlock, startObjectKeystring, user, pass }
Expand Down

0 comments on commit d8c5095

Please sign in to comment.