I am trying to run a background promise

I am trying to run a background promise to drain logs in a durable object that looks like this:
const res = new Response("broadcasted")
logger.Drain()
return res


With logger.Drain() looking like:
async (lines) => {
  console.log("draining logs!")
  await googleDestinationFunction(lines, c.env)
  console.log("done!")
}


Looking at my execution logs within cloudflare, I see only the draining logs! log, but not the done! log. I've also tried returning the googleDestinationFunction log directly (which also contains logs that I do not see) and it just seems like the DO is exiting once the promise starts running... It is my understanding that the DO should let any other promises run the in background, correct?
Was this page helpful?