fix(striker-ui-api): add env to control debug level on access child process

main
Tsu-ba-me 12 months ago
parent fff3d965c8
commit 4bb0a32764
  1. 8
      striker-ui-api/src/lib/accessModule.ts
  2. 7
      striker-ui-api/src/lib/consts/ENV.ts

@ -3,14 +3,16 @@ import EventEmitter from 'events';
import { readFileSync } from 'fs'; import { readFileSync } from 'fs';
import { import {
SERVER_PATHS, DEFAULT_JOB_PROGRESS,
DEBUG_ACCESS,
PGID, PGID,
PUID, PUID,
DEFAULT_JOB_PROGRESS,
REP_UUID, REP_UUID,
SERVER_PATHS,
} from './consts'; } from './consts';
import { formatSql } from './formatSql'; import { formatSql } from './formatSql';
import { repeat } from './repeat';
import { import {
date, date,
stderr as sherr, stderr as sherr,
@ -53,7 +55,7 @@ class Access extends EventEmitter {
} }
private start({ private start({
args = ['--emit-events'], args = ['--emit-events', repeat('v', DEBUG_ACCESS, { prefix: '-' })],
gid = PGID, gid = PGID,
restartInterval = 10000, restartInterval = 10000,
stdio = 'pipe', stdio = 'pipe',

@ -15,6 +15,13 @@ export const COOKIE_PREFIX = process.env.COOKIE_PREFIX ?? 'suiapi';
export const COOKIE_ORIGINAL_MAX_AGE: number = export const COOKIE_ORIGINAL_MAX_AGE: number =
Number(process.env.COOKIE_ORIGINAL_MAX_AGE) || 28800000; 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. * The fallback job progress value when queuing jobs.
* *

Loading…
Cancel
Save