clear the request timeout when adding/updating domain

DO API takes very long to respond at times :/ Currently, there is
no easy way to reset the timeout middleware timeout. We should add
this feature upstream (https://github.com/expressjs/timeout/issues/26)
This commit is contained in:
Girish Ramakrishnan
2018-03-08 09:27:56 -08:00
parent 22c54ced05
commit 6da7a7d2f4
2 changed files with 9 additions and 1 deletions

View File

@@ -60,7 +60,9 @@ function initializeExpressSync() {
router.del = router.delete; // amend router.del for readability further on
app
.use(middleware.timeout(REQUEST_TIMEOUT))
// the timeout middleware will respond with a 503. the request itself cannot be 'aborted' and will continue
// search for req.clearTimeout in route handlers to see places where this timeout is reset
.use(middleware.timeout(REQUEST_TIMEOUT, { respond: true }))
.use(json)
.use(urlencoded)
.use(middleware.cookieParser())