Skip to content

Commit

Permalink
Allow skuba node to run forever (#1449)
Browse files Browse the repository at this point in the history
  • Loading branch information
AaronMoat committed Feb 19, 2024
1 parent 3defb57 commit 78b7346
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/cli/node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import { parseRunArgs } from '../utils/args';
import { createExec } from '../utils/exec';
import { isIpPort } from '../utils/validation';

export const longRunning = true;

export const node = async () => {
const args = parseRunArgs(process.argv.slice(2));

Expand Down
7 changes: 6 additions & 1 deletion src/skuba.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,14 @@ const skuba = async () => {

const run = commandModule[moduleName] as () => Promise<unknown>;

if (commandModule.longRunning) {
// This is a long-running command, so we don't want to impose a timeout.
return run();
}

// If we're not in a CI environment, we don't need to worry about timeouts, which are primarily to prevent
// builds running "forever" in CI without our knowledge.
// Local commands may run for a long time, e.g. `skuba node` and `skuba start`, which are unlikely to be used in CI.
// Local commands may run for a long time, e.g. `skuba start` or `skuba test --watch`, which are unlikely to be used in CI.
if (!isCiEnv() || process.env.SKUBA_NO_TIMEOUT === 'true') {
return run();
}
Expand Down

0 comments on commit 78b7346

Please sign in to comment.