I have a provider that doesn't have api support and only exposes SMTP, so I was looking for some sol
I have a provider that doesn't have api support and only exposes SMTP, so I was looking for some solution, but I think this would be enough

ctx.waitUntil(foo()) not ctx.waitUntil(await foo())
waitUntil will keep your Worker alive, after returning a Response, until the promise resolves.canceled or daemon_down
ctx.waitUntil(foo())ctx.waitUntil(await foo())waitUntilcanceleddaemon_downasync function doStuff() {
await scheduler.wait(1000);
console.log('foo');
}
export default {
async fetch(req, env, ctx) {
ctx.waitUntil(doStuff());
return new Response('bar');
}
}export default {
async fetch(req, env, ctx) {
ctx.waitUntil(doStuff());
console.log('bar')
return new Response(null);
}
}bar
13:29:15 GET / 200
fooexport default {
async fetch(req, env, ctx) {
ctx.waitUntil(await doStuff());
console.log('bar')
return new Response(null);
}
}foo
bar
13:30:16 GET / 200 const variationR2Results: Array<{ width: number; id: string }> = [];
for (const variationResponse of variationResponses) {
const result = await context.env.MY_BUCKET.put(
variationResponse.key,
variationResponse.response.body,
{
httpMetadata: {
contentType,
},
}
);
variationR2Results.push({
id: result.key,
width: variationResponse.width,
});
}