Skip to content

Commit

Permalink
Back to most cpus
Browse files Browse the repository at this point in the history
  • Loading branch information
ardatan committed Oct 21, 2024
1 parent 68afe0a commit fefebea
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions packages/serve-cli/src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ export type AddCommand = (ctx: CLIContext, cli: CLI) => void;

// we dont use `Option.default()` in the command definitions because we want the CLI options to
// override the config file (with option defaults, config file will always be overwritten)
const maxAvailableFork = Math.max(availableParallelism() - 1, 1);
const maxAvailableFork = availableParallelism();
export const defaultOptions = {
fork: process.env.NODE_ENV === 'production' ? maxAvailableFork : 1,
host:
Expand All @@ -196,10 +196,7 @@ let cli = new Command()
.env('FORK')
.argParser(v => {
const count = parseInt(v);
if (isNaN(count)) {
throw new InvalidArgumentError('not a number.');
}
if (count > maxAvailableFork) {
if (isNaN(count) || count > maxAvailableFork) {
return maxAvailableFork;
}
return count;
Expand Down

0 comments on commit fefebea

Please sign in to comment.