update point duration

This commit is contained in:
Tanya Byrne
2020-08-18 13:05:37 +01:00
parent cc4e953e8b
commit 7019b194ee
4 changed files with 10 additions and 5 deletions

View File

@@ -41,7 +41,7 @@ const rateLimiter: RequestHandler = asyncHandler(async (req, res, next) => {
try {
await rateLimiterRedis.consume(req.ip);
} catch (rejRes) {
} catch (err) {
// If there is no error, rateLimiterRedis promise rejected with number of ms before next request allowed
const secs = Math.round(rejRes.msBeforeNext / 1000) || 1;
res.set('Retry-After', String(secs));