delete alert from db after sending

This commit is contained in:
saml33 2021-12-16 22:13:05 +11:00
parent bae24bbb94
commit 527bf3662c
1 changed files with 1 additions and 4 deletions

View File

@ -156,10 +156,7 @@ const handleAlert = async (alert: any, db: any) => {
message += "\nVisit: https://trade.mango.markets/"
const alertSent = await sendAlert(alert, message)
if (alertSent) {
db.collection("alerts").updateOne(
{ _id: new ObjectId(alert._id) },
{ $set: { open: false, triggeredTimestamp: Date.now() } }
)
db.collection("alerts").deleteOne({ _id: alert._id })
}
}
} catch (e) {