lundi 25 novembre 2019

Best way to implement recurring jobs with node-schedule and FB Send API?

I'm trying to schedule a Messenger bot to send a message everyday at 12:00 using node-schedule to multiple users. I'd like to find the best way to do so overall having in mind any server shutdown/restart or human errors, since jobs will only continue to execute while the app is running.

I was thinking on having all the recipient ids stored somewhere else than memory in case the server restarts. Load them into an array and perform a given sendMessage function for each recipient id using the schedule.scheduleJob() which runs every 24 hours. Would this be a decent approach?.

Aucun commentaire:

Enregistrer un commentaire