perf(S01/T01): Add token-bucket rate limiter (1 req/sec), SQLite respon…
- backend/explore/ratelimiter.go - backend/explore/cache.go - backend/database/sql/schemas/explore_cache.sql - backend/database/database.go
This commit is contained in:
1 parent
398fd5aaae
commit
8fc075c24a
9 files changed
+652
-1
No files matched your search
@@ -0,0 +1,10 @@
|
||||
CREATE TABLE IF NOT EXISTS explore_cache (
|
||||
url_key TEXT PRIMARY KEY,
|
||||
response TEXT NOT NULL,
|
||||
mbid TEXT,
|
||||
entity_type TEXT,
|
||||
expires_at DATETIME NOT NULL,
|
||||
created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP
|
||||
);
|
||||
CREATE INDEX IF NOT EXISTS idx_explore_cache_expires ON explore_cache(expires_at);
|
||||
CREATE INDEX IF NOT EXISTS idx_explore_cache_mbid ON explore_cache(mbid);
|
||||
Reference in new issue
Block a user