tjanczuk / iisnode

Hosting node.js applications in IIS on Windows
Other
1.85k stars 587 forks source link

Cron Jobs & IIS Node #525

Open mgarf opened 8 years ago

mgarf commented 8 years ago

I posted this on stackoverflow but I figure those with more knowledge with Node & IIS would be here.

I've seen some issues around this such as: #474 but am still confused by the solution

I'm trying to create cron jobs generated by administrator configuration in my application and stored in the database. The application runs using a Express, React, Redux, MSSQL stack. Digging around it seems that iisnode spins up a application instance for each connected user so adding a cron to the server.js file (express) seems unlikely to work.

How has others handled this? is iisnode not the right tool for this specific cron issue? should i be create a separate node application that just handles cron jobs using nssm? does nssm integrate with iisnode?

The cron job is pretty simple. Based on dates in the database it goes and pulls data from the database and sends out an email.

The cron job application has to run on a windows 2008 server, use nodejs, and pull from a MSSQL database.

Thank you in advance for any help with this!

christiaanwesterbeek commented 7 years ago

I don't see why you need IISnode. Just have a Node.js program do what it needs to do with the database and schedule that program with cron, windows task scheduler or whatever.

Iiridayn commented 6 years ago

We have a similar application - user controlled scheduled tasks (so we don't want to use the operating system scheduler) with a long running nodejs server, which we've been struggling to host on Azure. We do have an alternative HTTP interface for manually running tasks, so the application acts as both a cron server and a web server. From your answer in #209, it seems our naive assumption that Azure (using iisnode) would work for our scenario may have been optimistic.