SkepticMysticS
Denoβ€’4y ago
SkepticMystic

Is there an event that triggers when an Oak Deploy instance is closing?

I cannot find anything in the Deploy docs, specifically.
But I see that the Oak app runs a callback when the server closes. Something like this should work, I think:

app.listen({ port: 8080 }).then(() => {
    console.log('Shutting down...');
    db.collection('test').insertOne({ createdAt: new Date() })
});


But the console log doesn't run. Maybe the way Deploy closes instances doesn't allow for this?
Any advice would be really helpful
Was this page helpful?