mirror of
https://github.com/anomalyco/opencode.git
synced 2026-05-06 00:12:11 +00:00
zen: rate limiter
This commit is contained in:
parent
2c36bf9490
commit
8df7ccc304
12 changed files with 7757 additions and 23 deletions
|
|
@ -20,3 +20,13 @@ export const IpRateLimitTable = mysqlTable(
|
|||
},
|
||||
(table) => [primaryKey({ columns: [table.ip, table.interval] })],
|
||||
)
|
||||
|
||||
export const KeyRateLimitTable = mysqlTable(
|
||||
"key_rate_limit",
|
||||
{
|
||||
key: varchar("key", { length: 255 }).notNull(),
|
||||
interval: varchar("interval", { length: 40 }).notNull(),
|
||||
count: int("count").notNull(),
|
||||
},
|
||||
(table) => [primaryKey({ columns: [table.key, table.interval] })],
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue