diff --git a/striker-ui-api/src/lib/accessModule.ts b/striker-ui-api/src/lib/accessModule.ts index ab2a4d28..ee45ff6e 100644 --- a/striker-ui-api/src/lib/accessModule.ts +++ b/striker-ui-api/src/lib/accessModule.ts @@ -3,14 +3,16 @@ import EventEmitter from 'events'; import { readFileSync } from 'fs'; import { - SERVER_PATHS, + DEFAULT_JOB_PROGRESS, + DEBUG_ACCESS, PGID, PUID, - DEFAULT_JOB_PROGRESS, REP_UUID, + SERVER_PATHS, } from './consts'; import { formatSql } from './formatSql'; +import { repeat } from './repeat'; import { date, stderr as sherr, @@ -53,7 +55,7 @@ class Access extends EventEmitter { } private start({ - args = ['--emit-events'], + args = ['--emit-events', repeat('v', DEBUG_ACCESS, { prefix: '-' })], gid = PGID, restartInterval = 10000, stdio = 'pipe', diff --git a/striker-ui-api/src/lib/consts/ENV.ts b/striker-ui-api/src/lib/consts/ENV.ts index dd7fa2dd..8985870a 100644 --- a/striker-ui-api/src/lib/consts/ENV.ts +++ b/striker-ui-api/src/lib/consts/ENV.ts @@ -15,6 +15,13 @@ export const COOKIE_PREFIX = process.env.COOKIE_PREFIX ?? 'suiapi'; export const COOKIE_ORIGINAL_MAX_AGE: number = Number(process.env.COOKIE_ORIGINAL_MAX_AGE) || 28800000; +/** + * The debug level to pass to anvil-access-module; 1 is '-v', 2 is '-vv', ... + * + * @default 0 + */ +export const DEBUG_ACCESS = Number(process.env.DEBUG_ACCESS) || 0; + /** * The fallback job progress value when queuing jobs. *