sails js - check database every time

╄→尐↘猪︶ㄣ 提交于 2019-12-25 06:59:19

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!