0

I'm looking for a bit of assistance with node and task runners. I'm looking at grunt for a task runner but it may be a firetruck when I need a bucket.

I have a script that is ran as a cron job every 5 minutes. From that script I have some logic that if conditions are met then it needs to call another script.

The first script should finish execution and close but the spawned script will need to run.

What I'm doing, for context here, I have the first script checking a SVN repo and verifying revision number, if different it needs to update and then run a test suite.

Since the first script is only responsible for checking the repo and updating if necessary should run on its own and terminate on completion.

The next set of scripts needs to be executing under their own process. I'm basically setting up continuous integration and will be running several tasks, including unit tests, less/sass compilation, minification, etc.

I can use grunt if opted as the best and most efficient module for my situation.

Edit:
This question is simular to node.js child process - difference between spawn & fork
My particular question is that I want the parent to exit out and let the child run on. For this I assume I would use fork since I need a new v8 to run. Is this possible?

The first runner only does some quick logic to determine which set of operations to run.

Community
  • 1
  • 1
JeffBaumgardt
  • 1,378
  • 3
  • 16
  • 24
  • As long as your other scripts are executed asynchronously, wouldn't that allow your initial scheduled job to complete? – Andrew Church Apr 28 '14 at 14:56
  • Yes but since the other scripts can take a longer time to execute I don't want to hold up the scheduled task. This would prevent memory entanglement as the schedule will run a new process which in turn could run a new suite a tasks. I will write a lock file that will also prevent new scripts from running; but I still want the initial file to complete as it is only designed to perform one task. – JeffBaumgardt Apr 28 '14 at 15:09
  • fork, or adding queuing to keep your workers completely separate are probably your best bets. – Andrew Church May 01 '14 at 15:16

0 Answers0