2

I have a Node.js app running in multiple instances on google Cloud. The app has - among others - a scheduler ("node-cron": "^1.3.0") which sends a reminder mail to customers once every day. Now with multiple instances of the app, I get multiple mails - for each instance to same customer every day.

Is there a solution for this?

ER.SHASHI TIWARI
  • 917
  • 1
  • 10
  • 25

1 Answers1

2

It would be better to have an application running on App Engine and using cron.yaml to schedule jobs.

Node.js is now available for the standard environment of App Engine, so you can have a lightweight application with a fast and flexible autoscaling, ideal for the task of mailing once every day.

Héctor Neri
  • 1,384
  • 9
  • 13
  • thanks Neri, as of now i din't find any better solution then what i did, i have separated the scheduler code as a microservice and hosted in a single instance with load balancer. – ER.SHASHI TIWARI Oct 31 '18 at 09:35