summary refs log tree commit diff
path: root/api/src/middlewares/RateLimit.ts
diff options
context:
space:
mode:
authorFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-09-23 17:03:36 +0200
committerGitHub <noreply@github.com>2021-09-23 17:03:36 +0200
commit265dd70ce9964821c8d179e9636af39ac83881b0 (patch)
tree94eddae38c87522d56a5a08e4172aed4971c2320 /api/src/middlewares/RateLimit.ts
parentMerge pull request #394 from ChrisChrome/erlpack-fix (diff)
parent:bug: prepare/postinstall only works for packages not local npm install (diff)
downloadserver-265dd70ce9964821c8d179e9636af39ac83881b0.tar.xz
Merge pull request #372 from fosscord/unittests
Automatic Unittests + documentation
Diffstat (limited to 'api/src/middlewares/RateLimit.ts')
-rw-r--r--api/src/middlewares/RateLimit.ts3
1 files changed, 2 insertions, 1 deletions
diff --git a/api/src/middlewares/RateLimit.ts b/api/src/middlewares/RateLimit.ts
index d1fd072f..1a38cfcf 100644
--- a/api/src/middlewares/RateLimit.ts
+++ b/api/src/middlewares/RateLimit.ts
@@ -107,7 +107,8 @@ export default function rateLimit(opts: {
 }
 
 export async function initRateLimits(app: Router) {
-	const { routes, global, ip, error } = Config.get().limits.rate;
+	const { routes, global, ip, error, disabled } = Config.get().limits.rate;
+	if (disabled) return;
 	await listenEvent(EventRateLimit, (event) => {
 		Cache.set(event.channel_id as string, event.data);
 		event.acknowledge?.();