mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
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>
11 lines
265 B
Text
11 lines
265 B
Text
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);
|
|
---
|