Skip to content
This repository was archived by the owner on Jan 23, 2025. It is now read-only.

Commit 81bb5a2

Browse files
author
ykohata
committed
Merge branch 'kohata-i-127741-api-timeout' into technology-2014-10-02
2 parents acdca68 + 65a1d39 commit 81bb5a2

File tree

2 files changed

+33
-0
lines changed

2 files changed

+33
-0
lines changed

config/servers/web.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,9 @@ exports.default = {
5454
// When true, returnErrorCodes will modify the response header for http(s) clients if connection.error is not null.
5555
// You can also set connection.rawConnection.responseHttpCode to specify a code per request.
5656
returnErrorCodes: false
57+
,
58+
// http(s).Server#timeout
59+
timeout: 4 * 60 * 1000
5760
};
5861
}
5962
}

initializers/configurator.js

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
/*
2+
* Copyright (C) 2013 - 2014 TopCoder Inc., All Rights Reserved.
3+
*
4+
* @version 1.0
5+
* @author kohata
6+
*/
7+
"use strict";
8+
9+
exports.configurator = function(api, next){
10+
11+
api.configurator = {
12+
_start: function(api, next){
13+
this.configWeb(api);
14+
next();
15+
},
16+
configWeb: function(api){
17+
if(!api.servers || !api.servers.servers['web'] || !api.servers.servers['web'].server) {
18+
api.log('[configurator] web server has not been created.', 'warning');
19+
return;
20+
}
21+
22+
var timeout = api.config.servers.web.timeout || 10 * 60 * 1000;
23+
24+
api.servers.servers['web'].server.timeout = timeout;
25+
api.log('[configurator] web.server#timeout => '+timeout, 'info');
26+
}
27+
};
28+
29+
next();
30+
}

0 commit comments

Comments
 (0)