mirror of
https://github.com/ReCloudStudio/WebHooker.git
synced 2026-09-23 00:21:28 +00:00
fix(webhook): dedup duplicate deliveries, cache HMAC key, pass ExecutionContext
Skip re-processing when the same X-GitHub-Delivery id is seen (KV, 300s TTL) to stop double pushes when both an org and an App webhook target the worker. Pass ExecutionContext through so dispatch runs via waitUntil instead of a fire-and-forget that gets frozen. Cache the imported HMAC key per secret.
This commit is contained in:
parent
c75cc058fc
commit
befed0267a
3 changed files with 37 additions and 13 deletions
|
|
@ -9,8 +9,8 @@ export { DiscordGateway };
|
|||
const app = createServer();
|
||||
|
||||
export default {
|
||||
async fetch(request: Request, env: Env): Promise<Response> {
|
||||
return app.fetch(request, env);
|
||||
async fetch(request: Request, env: Env, ctx: ExecutionContext): Promise<Response> {
|
||||
return app.fetch(request, env, ctx);
|
||||
},
|
||||
|
||||
async scheduled(_event: ScheduledEvent, env: Env): Promise<void> {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue