mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
Add rate limit support to API
This allows us to prevent users from hammering the API every few seconds to check if any of their packages were updated. Real world users check as often as every 5 or 10 seconds. Signed-off-by: Florian Pritz <bluewind@xinu.at> Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
This commit is contained in:
parent
f51d4c32cd
commit
27654afadb
4 changed files with 111 additions and 0 deletions
11
upgrading/4.7.0.txt
Normal file
11
upgrading/4.7.0.txt
Normal file
|
@ -0,0 +1,11 @@
|
|||
1. Add ApiRateLimit table:
|
||||
|
||||
---
|
||||
CREATE TABLE `ApiRateLimit` (
|
||||
IP VARCHAR(45) NOT NULL,
|
||||
Requests INT(11) NOT NULL,
|
||||
WindowStart BIGINT(20) NOT NULL,
|
||||
PRIMARY KEY (`ip`)
|
||||
) ENGINE = InnoDB;
|
||||
CREATE INDEX ApiRateLimitWindowStart ON ApiRateLimit (WindowStart);
|
||||
---
|
Loading…
Add table
Add a link
Reference in a new issue