Fix timeout issue when adding lots of network ranges
This commit is contained in:
@@ -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));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user