0

I'm trying to create an auction application and I'm thinking of using node-schedule to determine when each auction end.

The idea is to run the auction countdown on the master process while leaving the api stuff to the workers. This way, even if the workers get crowded, the master process should be free and make sure the auctions end on time.

The problem is that I couldn't find anything online about using the master process for anything except for forking workers. So is this a good idea to do, or what would the alternative be?

Combustible Pizza
  • 315
  • 1
  • 2
  • 8

1 Answers1

0

Yes you can use your code in master


    // Include the cluster module

    var cluster = require('cluster');

    if(cluster.isMaster){
      //here you can run the auction countdown code
    }ele{
       //workers
     }