Skip to content

feat(workers): add defineWorkerFetch and waitUntil for async drains#311

Merged
HugoRCD merged 1 commit intomainfrom
fix/workers-drain-waituntil
Apr 29, 2026
Merged

feat(workers): add defineWorkerFetch and waitUntil for async drains#311
HugoRCD merged 1 commit intomainfrom
fix/workers-drain-waituntil

Conversation

@HugoRCD
Copy link
Copy Markdown
Owner

@HugoRCD HugoRCD commented Apr 27, 2026

🔗 Linked issue

Resolves #300

📚 Description

📝 Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

@HugoRCD HugoRCD self-assigned this Apr 27, 2026
@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 27, 2026

Deployment failed with the following error:

There is no GitHub account connected to this Vercel account.

@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 27, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
evlog-docs Error Error Open in v0 Apr 27, 2026 9:26pm

@github-actions
Copy link
Copy Markdown
Contributor

Thank you for following the naming conventions! 🙏

@github-actions
Copy link
Copy Markdown
Contributor

Benchmark report

Bundle size

Threshold: 5% · 🔴 larger · 🟡 warning · 🟢 smaller · ⚪ unchanged · 🆕 new

Status Entry Base (gzip) Current (gzip) Change Raw delta
🔴 workers 982 B 1.31 kB +36.5% +1.06 kB
framework/nitro 6.86 kB 6.86 kB 0.0% 0 B
framework/ai 4.25 kB 4.25 kB 0.0% 0 B
adapter/datadog 2.45 kB 2.45 kB 0.0% 0 B
framework/vite 2.41 kB 2.41 kB 0.0% 0 B
adapter/sentry 2.35 kB 2.35 kB 0.0% 0 B
adapter/otlp 2.10 kB 2.10 kB 0.0% 0 B
enrichers 1.92 kB 1.92 kB 0.0% 0 B
utils 1.59 kB 1.59 kB 0.0% 0 B
adapter/posthog 1.51 kB 1.51 kB 0.0% 0 B
error 1.46 kB 1.46 kB 0.0% 0 B
adapter/fs 1.42 kB 1.42 kB 0.0% 0 B
pipeline 1.36 kB 1.36 kB 0.0% 0 B
adapter/axiom 1.33 kB 1.33 kB 0.0% 0 B
http 1.23 kB 1.23 kB 0.0% 0 B
adapter/hyperdx 1.19 kB 1.19 kB 0.0% 0 B
adapter/better-stack 1.09 kB 1.09 kB 0.0% 0 B
browser 291 B 291 B 0.0% 0 B
client 128 B 128 B 0.0% 0 B
types 31 B 31 B 0.0% 0 B
framework/next 4.24 kB 4.24 kB -0.1% 0 B
framework/sveltekit 1.60 kB 1.60 kB -0.1% 0 B
framework/express 772 B 771 B -0.1% 0 B
framework/nestjs 1.28 kB 1.27 kB -0.2% 0 B
framework/fastify 1.06 kB 1.05 kB -0.2% 0 B
framework/elysia 1.15 kB 1.15 kB -0.3% 0 B
toolkit 316 B 315 B -0.3% 0 B
framework/hono 614 B 612 B -0.3% 0 B
core (index) 426 B 424 B -0.5% 0 B
logger 211 B 209 B -0.9% 0 B
Total 47.51 kB 47.84 kB +0.7% +1.06 kB

@HugoRCD
Copy link
Copy Markdown
Owner Author

HugoRCD commented Apr 27, 2026

@wladpaiva Could you try whether the bug still exists using this new method and pkg.pr.new?
npm i https://pkg.pr.new/evlog@311

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented Apr 27, 2026

npm i https://pkg.pr.new/evlog@311
npm i https://pkg.pr.new/@evlog/nuxthub@311

commit: 3d5a764

@wladpaiva
Copy link
Copy Markdown

Awesome! It works by using initLogger in combination with
createRequestLogger(request, { waitUntil: locals.cfContext.waitUntil.bind(locals.cfContext) })

Thanks @HugoRCD

@HugoRCD HugoRCD merged commit f68b2dd into main Apr 29, 2026
13 of 15 checks passed
@HugoRCD HugoRCD deleted the fix/workers-drain-waituntil branch April 29, 2026 21:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[bug] Drain fails on Cloudflare Workers using Astro

2 participants