SkepticMystic
SkepticMystic3y ago

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() })
});
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
0 Replies
No replies yetBe the first to reply to this messageJoin

Did you find this page helpful?