I have a sorta vague question bc I'm not sure what...
# random
d
I have a sorta vague question bc I'm not sure what the phrasing to search for is... I'm building an app that schedules an event in the future. After that date has passed, an order receipt needs to be processed. How do I keep track when the dates have passed? I could use cron jobs but that just doesn't seem right... do I repeatedly query the entire database to check for 'passed-dates'? Not really sure what the language is here so it's hard to find anything online to explain this. How can I tell when a date has passed?
j
Sounds like a case for querying, and triggering an email. You could do something like: https://docs.aws.amazon.com/AmazonCloudWatch/latest/events/RunLambdaSchedule.html
which is basically schedule a lamda to run every X
d
interesting... pretty much what I'm looking for. Wonder if there's a node equivalent so I wouldn't have to set up another external service
j
well, what's your infrastructure?
self-managed vps?
d
yeah eventually... on a prisma demo right now
and heroku
it seems like a lambda is basically the same as running a node cron job every X minutes to query for past dates
unless i'm missing something
this might fit in better
d
amazing... thnx!
j
👍