mirror of
https://github.com/tiennm99/claude-status-webhook.git
synced 2026-04-17 15:20:37 +00:00
refactor: update bindings to match CF resource names
KV binding: claude_status, Queue binding: claude-status. Real KV namespace ID configured with remote flag.
This commit is contained in:
@@ -69,14 +69,14 @@ export async function handleStatuspageWebhook(c) {
|
||||
}
|
||||
|
||||
// Get filtered subscribers
|
||||
const subscribers = await getSubscribersByType(c.env.CLAUDE_STATUS, category);
|
||||
const subscribers = await getSubscribersByType(c.env.claude_status, category);
|
||||
|
||||
// Enqueue messages for fan-out via CF Queues (batch for performance)
|
||||
const messages = subscribers.map(({ chatId, threadId }) => ({
|
||||
body: { chatId, threadId, html },
|
||||
}));
|
||||
for (let i = 0; i < messages.length; i += 100) {
|
||||
await c.env.STATUS_QUEUE.sendBatch(messages.slice(i, i + 100));
|
||||
await c.env["claude-status"].sendBatch(messages.slice(i, i + 100));
|
||||
}
|
||||
|
||||
return c.text("OK", 200);
|
||||
|
||||
Reference in New Issue
Block a user