Skip to content

Commit 5135700

Browse files
committed
Add a 5s timeout to requests
1 parent 4d44b57 commit 5135700

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

lib/start-proxy-action.js

Lines changed: 7 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/start-proxy/reachability.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,12 @@ class NetworkReachabilityBackend implements ReachabilityBackend {
5151
return new Promise((resolve, reject) => {
5252
const req = https.request(
5353
getAddressString(registry),
54-
{ agent: this.agent, method: "HEAD", ca: this.proxy.cert },
54+
{
55+
agent: this.agent,
56+
method: "HEAD",
57+
ca: this.proxy.cert,
58+
timeout: 5 * 1000, // 5 seconds
59+
},
5560
(res) => {
5661
res.destroy();
5762

0 commit comments

Comments
 (0)