mirror of
https://github.com/roleypoly/roleypoly.git
synced 2025-06-17 09:59:10 +00:00
miniflare init
This commit is contained in:
parent
8c07ed3123
commit
688954a2e0
52 changed files with 898 additions and 25 deletions
18
packages/api/old-src/handlers/clear-guild-cache.ts
Normal file
18
packages/api/old-src/handlers/clear-guild-cache.ts
Normal file
|
@ -0,0 +1,18 @@
|
|||
import { asEditor, getGuild, GuildRateLimiterKey } from '../utils/guild';
|
||||
import { notFound, ok } from '../utils/responses';
|
||||
|
||||
export const ClearGuildCache = asEditor(
|
||||
{
|
||||
rateLimitKey: GuildRateLimiterKey.cacheClear,
|
||||
rateLimitTimeoutSeconds: 60 * 5,
|
||||
},
|
||||
(session, { guildID }) =>
|
||||
async (request: Request): Promise<Response> => {
|
||||
const result = await getGuild(guildID, { skipCachePull: true });
|
||||
if (!result) {
|
||||
return notFound();
|
||||
}
|
||||
|
||||
return ok();
|
||||
}
|
||||
);
|
Loading…
Add table
Add a link
Reference in a new issue