docs: restore parseNiceFlag docblock displaced by PRUNE_STATUSES; note --status/0d in top-level jobs help

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Garry Tan
2026-07-22 11:20:16 -07:00
co-authored by Claude Fable 5
parent dfe1755da6
commit 09f9b00f86
2 changed files with 6 additions and 6 deletions
+1 -1
View File
@@ -2387,7 +2387,7 @@ JOBS (Minions)
jobs get <id> Job details + history
jobs cancel <id> Cancel job
jobs retry <id> Re-queue failed/dead job
jobs prune [--older-than 30d] Clean old jobs
jobs prune [--older-than 30d] [--status s,..] Clean old terminal jobs (0d = no age floor)
jobs stats Job health dashboard
jobs work [--queue Q] Start worker daemon (Postgres only)
+5 -5
View File
@@ -106,11 +106,6 @@ export function parseMaxRssFlag(args: string[]): number | undefined {
return parsed;
}
/** Parse `--nice N` (then `GBRAIN_NICE` env). Returns:
* - undefined if absent (no priority change — inherit)
* - the validated integer in [-20, 19] otherwise
* Errors and exits the process on non-integer / out-of-range input (mirrors
* parseMaxRssFlag's fail-fast). Flag wins over env. (issue #1815) */
/** Terminal statuses `jobs prune --status` accepts (PR #2282). Matches what
* queue.prune can safely delete; anything else (waiting/active/…) is live. */
export const PRUNE_STATUSES = ['completed', 'failed', 'dead', 'cancelled'] as const satisfies readonly MinionJobStatus[];
@@ -126,6 +121,11 @@ export function parsePruneStatuses(raw: string): MinionJobStatus[] {
return requested as MinionJobStatus[];
}
/** Parse `--nice N` (then `GBRAIN_NICE` env). Returns:
* - undefined if absent (no priority change — inherit)
* - the validated integer in [-20, 19] otherwise
* Errors and exits the process on non-integer / out-of-range input (mirrors
* parseMaxRssFlag's fail-fast). Flag wins over env. (issue #1815) */
export function parseNiceFlag(args: string[], env: NodeJS.ProcessEnv = process.env): number | undefined {
const raw = parseFlag(args, '--nice') ?? env.GBRAIN_NICE;
if (raw === undefined || raw === '') return undefined;