问题
I have a schedule manager web application where the system will check every hour if current time is passing the due date that stored in database and will send an email if the current time pass the due date even if the user doesn't open the web app. Can sails js alone do something like this?
回答1:
You'll probably want to schedule a cron
job which executes a script at a set interval to do this for you.
You can read up on cron and decide what works best for you; in general you'll probably want to have a separate script that is executable from the command line (such as a send_emails.js
which you can execute with node send_emails.js
).
来源:https://stackoverflow.com/questions/36416832/sails-js-check-database-every-time