Skip to content

Commit a50f88a

Browse files
djwhittclaude
andcommitted
perf(observer): reduce timeout to 7 seconds for more cautious approach
- Reduce socket timeout from 10s to 7s - Reduce all request timeouts from 10s to 7s - Provides a balance between allowing slow gateways time to respond and preventing excessive wait times 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
1 parent 84479c1 commit a50f88a

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/observer.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ const client = got.extend({
8080
lookup: 5000,
8181
connect: 5000,
8282
secureConnect: 2000,
83-
socket: 10000,
83+
socket: 7000,
8484
},
8585
});
8686

@@ -475,7 +475,7 @@ export class Observer {
475475

476476
try {
477477
const response = await this.gotClient.get(url, {
478-
timeout: { request: 10000 },
478+
timeout: { request: 7000 },
479479
responseType: 'json',
480480
});
481481

@@ -543,7 +543,7 @@ export class Observer {
543543

544544
try {
545545
const response = await this.gotClient.get(url, {
546-
timeout: { request: 10000 },
546+
timeout: { request: 7000 },
547547
responseType: 'json',
548548
});
549549

@@ -609,7 +609,7 @@ export class Observer {
609609

610610
try {
611611
const response = await this.gotClient.get(url, {
612-
timeout: { request: 10000 },
612+
timeout: { request: 7000 },
613613
responseType: 'json',
614614
});
615615

@@ -1073,7 +1073,7 @@ export class Observer {
10731073
// Fetch chunk data and proof from gateway
10741074

10751075
const response = await this.gotClient.get(url, {
1076-
timeout: { request: 10000 },
1076+
timeout: { request: 7000 },
10771077
responseType: 'json',
10781078
});
10791079

@@ -1137,7 +1137,7 @@ export class Observer {
11371137
});
11381138

11391139
const referenceResponse = await this.gotClient.get(referenceUrl, {
1140-
timeout: { request: 10000 },
1140+
timeout: { request: 7000 },
11411141
responseType: 'json',
11421142
});
11431143

0 commit comments

Comments
 (0)