Skip to content
This repository has been archived by the owner on Sep 16, 2024. It is now read-only.

Commit

Permalink
chore: increase timeout to 3 mins
Browse files Browse the repository at this point in the history
  • Loading branch information
dtfiedler committed Jan 4, 2024
1 parent 6198b5b commit fc2829a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
5 changes: 3 additions & 2 deletions src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import {
import logger from './logger';
import { uncaughtExceptionError } from './metrics';
import { queryMiddleware } from './middleware/query';
import { DEFAULT_REQUEST_TIMEOUT_MS } from './constants';

const app = new Koa();

Expand Down Expand Up @@ -60,8 +61,8 @@ process.on('SIGINT', () => {

const serverConfigs = {
port: +(process.env.PORT || 3000),
keepAliveTimeout: 120_000, // two minute timeout for connections
requestTimeout: 120_000, // two minute timeout for requests
keepAliveTimeout: DEFAULT_REQUEST_TIMEOUT_MS,
requestTimeout: DEFAULT_REQUEST_TIMEOUT_MS,
};

app.listen(serverConfigs, () => {
Expand Down
3 changes: 2 additions & 1 deletion src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,11 @@ import { EvaluationOptions } from 'warp-contracts';
export const ARNS_CONTRACT_ID_REGEX = '([a-zA-Z0-9-_s+]{43})';
export const ARNS_NAME_REGEX = '([a-zA-Z0-9-s+]{1,51})';
export const SUB_CONTRACT_EVALUATION_TIMEOUT_MS = 10_000; // 10 sec state timeout - non configurable
export const DEFAULT_REQUEST_TIMEOUT_MS = 180_000;
export const DEFAULT_STATE_EVALUATION_TIMEOUT_MS = process.env
.EVALUATION_TIMEOUT_MS
? +process.env.EVALUATION_TIMEOUT_MS
: 1000 * 60 * 2; // 2 min state timeout (should be <= koa request timeout)
: DEFAULT_REQUEST_TIMEOUT_MS; // 3 min state timeout (should be <= koa request timeout)
export const allowedContractTypes = ['ant'] as const;
export const DEFAULT_EVALUATION_OPTIONS: Partial<EvaluationOptions> = {
maxInteractionEvaluationTimeSeconds: 3600, // one hour
Expand Down

0 comments on commit fc2829a

Please sign in to comment.