We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
waitUntil
When calling waitUntil inside another waitUntil, the nested waitUntil should also be awaited. This does not happen in Miniflare v2.
Minimal repro:
import { Miniflare } from "miniflare"; const mf = new Miniflare({ script: ` const delay = (n) => new Promise((res) => setTimeout(res, n)) export default { async fetch(req, env, ctx) { const fn = async () => { await delay(2000); ctx.waitUntil(delay(2000).then(()=>{ console.log("nested waitUntil promise resolved") })) console.log("fn resolved") }; ctx.waitUntil(fn()) return new Response("ok", { status: 200 }) } }`, modules: true, compatibilityDate: "2023-03-30" }); const res = await mf.dispatchFetch("https://test", { method: "GET" }); console.log("received response") await res.waitUntil() console.log("wait until done")
nested waitUntil promise resolved is never logged.
nested waitUntil promise resolved
The text was updated successfully, but these errors were encountered:
Successfully merging a pull request may close this issue.
When calling
waitUntil
inside anotherwaitUntil
, the nestedwaitUntil
should also be awaited. This does not happen in Miniflare v2.Minimal repro:
nested waitUntil promise resolved
is never logged.The text was updated successfully, but these errors were encountered: