Got 100% test coverage of new rate limits

This commit is contained in:
Chris Troutner
2021-03-08 19:47:37 -08:00
parent 137cacd1da
commit 8345311284
2 changed files with 184 additions and 12 deletions
+4 -3
View File
@@ -149,9 +149,10 @@ class RateLimits {
// and avoid this code path. This code path is 'pooled': all users
// share the same rate limits. Even at 1000 RPM, this pool will get
// exhausted easily.
console.log(
const warnMsg =
'Internal call. req.body.usrObj does not exist. Applying high-speed internal rate limits.'
)
console.log(warnMsg)
wlogger.info(warnMsg)
const defaultPayload = {
id: '98.76.54.32',
@@ -208,7 +209,7 @@ class RateLimits {
}
}
} catch (err) {
console.error('Error in route-ratelimit2.js/applyRateLimits(): ', err)
wlogger.error('Error in route-ratelimit2.js/applyRateLimits(): ', err)
}
// By default, move to the next middleware.