[test] Remove terminate-when-inactive behavior from the test server

It caused #3163.

Attempts at having the child exit automatically when the parent exits were stymied
by the fact that unix sucks: http://stackoverflow.com/q/284325/52207.
This commit is contained in:
John Firebaugh
2016-01-04 17:06:36 -08:00
parent af4b9599cb
commit 79368a0ecf

View File

@@ -9,19 +9,6 @@ var app = express();
// We're manually setting Etag headers.
app.disable('etag');
// Terminate after a certain time of inactivity.
function terminate() {
console.warn('Server terminated due to inactivity');
process.exit(0);
};
var inactivity = 5000; // milliseconds
var timeout = setTimeout(terminate, inactivity);
app.use(function(req, res, next) {
clearTimeout(timeout);
timeout = setTimeout(terminate, inactivity);
next();
});
app.get('/test', function (req, res) {
if (req.query.modified) {
res.setHeader('Last-Modified', (new Date(req.query.modified * 1000)).toUTCString());