Fix timeout issue when adding lots of network ranges

This commit is contained in:
Girish Ramakrishnan
2020-09-14 09:56:35 -07:00
parent 166c06c628
commit 467fa59023

View File

@@ -25,6 +25,8 @@ function setBlocklist(req, res, next) {
if (!Array.isArray(req.body.blocklist)) return next(new HttpError(400, 'blocklist is required'));
if (!req.body.blocklist.every(x => typeof x === 'string')) return next(new HttpError(400, 'blocklist must be array of strings'));
req.clearTimeout(); // can take a while if there is a lot of network ranges
network.setBlocklist(req.body.blocklist, function (error) {
if (error) return next(BoxError.toHttpError(error));