0

I m using package for task sechdule in my nodejs/parseserver open source https://www.npmjs.com/package/node-cron but even i comment the job and restarted servert ...job seems running.....can some one guide me here??

  var counter=0;
  Parse.Cloud.define("test", function(request, response) {

 response.success(counter+1); 
  });

//var cron = require('node-cron');
//var task=cron.schedule('*/1 * * * *', function(){
/* Parse.Cloud.run('test',{}, {
        success: function(results) {
            console.log('test');
            response.success(results);
        },
        error: function(error) {
            response.error("Some error.");
        }
      });  */

//console.log('job creared loop');
 //});
MSGK
  • 1
  • 7

1 Answers1

0

It sounds like the file where the cronjob is, is not loading with the changes. But some information is missing from your question I think.

Which server are you referring to & what server: 1. Are you just running the node fafa.js program again? 2. Are you working with Forever or PM2? If PM2 you need to

sudo pm2 restart [name of file]

  1. Are you completely restarting the whole server??? (AWS etc)

Perhaps a simple

console.log("see if cron job runs")

within the code will show you what is going on. Obviously if the console.log does not appear the old code is still running.

I think if the above is not the case we would need more information.

twg
  • 1,075
  • 7
  • 11
  • I m using nodejs/express server and backend is parse server(mongo db)...this server is like i can say like fire base....backend provider....i m running the above job on the api( what they call as cloud code).......do u we have any way to kill jobs in node js/express js manually... – MSGK Mar 16 '17 at 10:54
  • @MSGK do not completely understand what you are trying to say. However in node_cron the package you are using there is the possibility of adding to your code: `task.stop();` or: `task.destroy();` which will either stop or destroy the cron job. Perhaps you should try that when the node server goes down. Not sure what you mean in your message above though. – twg Mar 16 '17 at 10:59