tony
tony
Explore posts from servers
CDCloudflare Developers
Created by tony on 4/30/2024 in #workers-help
executionCtx.waitUntil on write service
working code:
const promise = fetch(`${DO_URL}impressions`, {
method: "POST",
body: JSON.stringify(data),
headers: {
"content-type": "application/json",
}
})

c.executionCtx.waitUntil(promise.then(async (response) => {
const imp = await response.json()
console.log("Impression created", JSON.stringify(imp))
}))
const promise = fetch(`${DO_URL}impressions`, {
method: "POST",
body: JSON.stringify(data),
headers: {
"content-type": "application/json",
}
})

c.executionCtx.waitUntil(promise.then(async (response) => {
const imp = await response.json()
console.log("Impression created", JSON.stringify(imp))
}))
19 replies
CDCloudflare Developers
Created by tony on 4/30/2024 in #workers-help
executionCtx.waitUntil on write service
Okay this is now working
19 replies
CDCloudflare Developers
Created by tony on 4/30/2024 in #workers-help
executionCtx.waitUntil on write service
got the request working updated the code in the message above.
19 replies