Skip to content

Commit 8cb7d43

Browse files
authored
fix(graphql-codegen-cli): Don't hang when 0 CPUs are found (#10569)
* fix(graphql-codegen-cli): Don't hang when 0 CPUs are found * Add changeset
1 parent 08e67b4 commit 8cb7d43

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

.changeset/ready-ravens-swim.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
'@graphql-codegen/cli': patch
3+
---
4+
5+
fix(graphql-codegen-cli): Don't hang when 0 CPUs are found
6+
7+
Fixes generation when 0 CPUs are returned by os.cpus(), which occurs in sandbox environments.

packages/graphql-codegen-cli/src/codegen.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -423,7 +423,7 @@ export async function executeCodegen(
423423
};
424424
});
425425

426-
return task.newListr(generateTasks, { concurrent: cpus().length });
426+
return task.newListr(generateTasks, { concurrent: cpus().length || 1 });
427427
},
428428
},
429429
],

0 commit comments

Comments
 (0)