flyingshoes
flyingshoes
CDCloudflare Developers
Created by flyingshoes on 12/9/2024 in #hyperdrive
unexpected errors
hmmm, yeah. that's helpful. I'm realizing it might be something with our db connection code rather than our busines logic. I'll do more investigating. thank you!
16 replies
CDCloudflare Developers
Created by flyingshoes on 12/9/2024 in #hyperdrive
unexpected errors
So our waitUntil setup is like this:
const telemetryCall = (dbResults) => {
// where we actually call into the telemetry library
waitUntil(actualTelemetryCall(dbResults)) // do I need to return here?
}

const telemetryCall = async () => {
// make DB call to enrich data for our telemetry call
Const dbResults = await dbCall()

actualTelemetryCall(dbResults) // do I need to return here?
}

const controller = () => {
// this is tied to an endpoint.
// at very end of logic, call telemetry
waitFor(telemetryCall)
}
const telemetryCall = (dbResults) => {
// where we actually call into the telemetry library
waitUntil(actualTelemetryCall(dbResults)) // do I need to return here?
}

const telemetryCall = async () => {
// make DB call to enrich data for our telemetry call
Const dbResults = await dbCall()

actualTelemetryCall(dbResults) // do I need to return here?
}

const controller = () => {
// this is tied to an endpoint.
// at very end of logic, call telemetry
waitFor(telemetryCall)
}
I’m not the best with nested waitUntil, but I’m wondering if I’m not awaiting somewhere to ensure the connection stays open until everything is finished? thanks again!
16 replies