Skip to content

Commit

Permalink
Merge pull request #265 from gemini-testing/increase-timeouts-for-gui…
Browse files Browse the repository at this point in the history
…-server

fix: increase timeouts for GUI server
  • Loading branch information
CatWithApple authored Sep 23, 2019
2 parents e3bb988 + 0cae66a commit d51bfb8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 3 additions & 1 deletion lib/gui/constants/server.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
'use strict';

module.exports = {
MAX_REQUEST_SIZE: '100mb'
MAX_REQUEST_SIZE: '100mb',
KEEP_ALIVE_TIMEOUT: 120 * 1000,
HEADERS_TIMEOUT: 125 * 1000
};
6 changes: 4 additions & 2 deletions lib/gui/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const onExit = require('signal-exit');
const Promise = require('bluebird');
const bodyParser = require('body-parser');
const App = require('./app');
const {MAX_REQUEST_SIZE} = require('./constants/server');
const {MAX_REQUEST_SIZE, KEEP_ALIVE_TIMEOUT, HEADERS_TIMEOUT} = require('./constants/server');
const {logger} = require('../server-utils');

exports.start = ({paths, tool, guiApi, configs}) => {
Expand Down Expand Up @@ -70,7 +70,9 @@ exports.start = ({paths, tool, guiApi, configs}) => {
return app.initialize()
.then(() => {
return Promise.fromCallback((callback) => {
server.listen(options.port, options.hostname, callback);
const httpServer = server.listen(options.port, options.hostname, callback);
httpServer.keepAliveTimeout = KEEP_ALIVE_TIMEOUT;
httpServer.headersTimeout = HEADERS_TIMEOUT;
});
})
.then(() => {
Expand Down

0 comments on commit d51bfb8

Please sign in to comment.