Files
WebHooker/wrangler.jsonc
T
翅膀 4fc784ab9f fix(queue): bound batches and resume deliveries
A queue invocation has shared query and subrequest limits.
Use a small batch and shared send budget, renew fenced leases and
resume only unfinished work without exhausting unstarted messages.
2026-10-23 23:23:35 +08:00

70 lines
1.5 KiB
JSON

{
"name": "webhooker",
"account_id": "d157d30ef8fd945995f22bf99c5c67b9",
"main": ".output/server/index.mjs",
"compatibility_date": "2026-08-04",
"compatibility_flags": [
"nodejs_compat"
],
"build": {
"command": "bun run build"
},
"assets": {
"directory": "./.output/public",
"binding": "ASSETS",
"run_worker_first": true
},
"triggers": {
"crons": [
"*/5 * * * *"
]
},
"kv_namespaces": [
{
"binding": "KV",
"id": "a471e264837d4f51b077e078022f0cf0"
},
],
// Optional: R2 for oversized payloads. Uncomment after enabling R2 and running
// `bunx wrangler r2 bucket create webhooker-payloads`. Without this binding the
// worker falls back to KV `queue:payload:*`.
// "r2_buckets": [
// {
// "binding": "PAYLOAD",
// "bucket_name": "webhooker-payloads",
// }
// ],
"d1_databases": [
{
"binding": "DB",
"database_name": "webhooker",
"database_id": "8af03c0a-2f18-467c-9c04-7761997cf20b"
},
],
"queues": {
"producers": [
{
"queue": "webhooker-delivery",
"binding": "QUEUE",
}
],
"consumers": [
{
"queue": "webhooker-delivery",
// Small batches: one invocation may make 50 D1 queries and 50
// subrequests on Workers Free, and a delivery takes ~7 + its sends.
"max_batch_size": 3,
"max_batch_timeout": 30,
"max_retries": 5,
"dead_letter_queue": "webhooker-delivery-dlq"
},
{
"queue": "webhooker-delivery-dlq",
"max_batch_size": 10,
"max_batch_timeout": 30,
"max_retries": 1
}
]
},
}