Skip to content

Commit e0d67dd

Browse files
committed
Postinstall: Move number to constant
Addresses review comment: rancher-sandbox#7265 (comment) Signed-off-by: Mark Yen <[email protected]>
1 parent edef5b6 commit e0d67dd

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

scripts/postinstall.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,11 @@ type DependencyWithContext = {
2121
context: DownloadContext;
2222
};
2323

24+
/**
25+
* The amount of time we allow the post-install script to run, in milliseconds.
26+
*/
27+
const InstallTimeout = 10 * 60 * 1_000; // Ten minutes.
28+
2429
// Dependencies that should be installed into places that users touch
2530
// (so users' WSL distros and hosts as of the time of writing).
2631
const userTouchedDependencies = [
@@ -130,7 +135,7 @@ async function downloadDependencies(items: DependencyWithContext[]): Promise<voi
130135
promises[specialize(item)] = process(specialize(item));
131136
}
132137

133-
const abortSignal = AbortSignal.timeout(10 * 60 * 1_000);
138+
const abortSignal = AbortSignal.timeout(InstallTimeout);
134139

135140
while (!abortSignal.aborted && running.size > done.size) {
136141
const timeout = new Promise((resolve) => {

0 commit comments

Comments
 (0)