Skip to content

Commit 8a7a4ba

Browse files
committed
chore: fix web3-adapter timeout
1 parent aba530f commit 8a7a4ba

File tree

2 files changed

+8
-12
lines changed

2 files changed

+8
-12
lines changed

infrastructure/web3-adapter/src/evault/evault.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,15 @@ export interface MetaEnvelope {
1111

1212
// Configuration constants
1313
const CONFIG = {
14-
REQUEST_TIMEOUT: 30000, // 30 seconds
15-
CONNECTION_TIMEOUT: 10000, // 10 seconds
14+
REQUEST_TIMEOUT: 5000, // 5 seconds
15+
CONNECTION_TIMEOUT: 5000, // 5 seconds
1616
TOKEN_REFRESH_THRESHOLD: 5 * 60 * 1000, // 5 minutes before expiry
1717
MAX_RETRIES: 3,
1818
RETRY_DELAY: 1000, // 1 second base delay
1919
CONNECTION_POOL_SIZE: 10,
20-
HEALTH_CHECK_TIMEOUT: 5000, // 5 seconds for health check
21-
MAX_HEALTH_CHECK_FAILURES: 3, // Max consecutive failures before re-resolution
22-
GRAPHQL_TIMEOUT: 10000, // 10 seconds for GraphQL requests before considering endpoint unhealthy
20+
HEALTH_CHECK_TIMEOUT: 2000, // 2 seconds for health check
21+
MAX_HEALTH_CHECK_FAILURES: 1, // Max consecutive failures before re-resolution (much more aggressive!)
22+
GRAPHQL_TIMEOUT: 5000, // 5 seconds for GraphQL requests before considering endpoint unhealthy
2323
} as const;
2424

2525
const STORE_META_ENVELOPE = `
@@ -350,8 +350,8 @@ export class EVaultClient {
350350
const lastCheck = this.lastHealthCheck.get(w3id) || 0;
351351
const timeSinceLastCheck = now - lastCheck;
352352

353-
// Only check every 30 seconds to avoid performance impact
354-
if (timeSinceLastCheck < 30000) {
353+
// Only check every 10 seconds to avoid performance impact
354+
if (timeSinceLastCheck < 10000) {
355355
return true; // Assume healthy if checked recently
356356
}
357357

platforms/marketplace/server/index.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,7 @@ app.use((req, res, next) => {
4040
}
4141

4242
const port = parseInt(process.env.PORT || '5000', 10);
43-
server.listen({
44-
port,
45-
host: "0.0.0.0",
46-
reusePort: true,
47-
}, () => {
43+
server.listen(port, () => {
4844
log(`Marketplace UI server running on port ${port}`);
4945
});
5046
})();

0 commit comments

Comments
 (0)