Skip to content

Commit

Permalink
fix(rest): add separate ratelimit for messages <=10s old (#1267)
Browse files Browse the repository at this point in the history
Co-authored-by: bsian03 <chharry321@gmail.com>
  • Loading branch information
abalabahaha and bsian03 committed Nov 17, 2021
1 parent bc8245c commit 0f3ebc8
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/rest/RequestHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -402,6 +402,8 @@ class RequestHandler {
const createdAt = Base.getCreatedAt(messageID);
if(Date.now() - this.latencyRef.latency - createdAt >= 1000 * 60 * 60 * 24 * 14) {
method += "_OLD";
} else if(Date.now() - this.latencyRef.latency - createdAt <= 1000 * 10) {
method += "_NEW";
}
route = method + route;
}
Expand Down

0 comments on commit 0f3ebc8

Please sign in to comment.