scheduleAndStore saves the cron-job in database but it doesn't get active immediate after it's registration. Let have a scenario an user on a live project registered a cron job by hitting an api. It should be active immediate but not working as expected.
scheduleAndStore saves the cron-job in database but it doesn't get active immediate after it's registration. Let have a scenario an user on a live project registered a cron job by hitting an api. It should be active immediate but not working as expected.
`var url = "mongodb://localhost:27017/my-test-db"; drone.setConfig( { persistence: { type: 'mongodb', connectionString: url, eventsCollection: 'schedular', options: {} } } );
scheduler = drone.daemon(); try { setTimeout(() => { scheduler.scheduleAndStore(' ', 'my-job', { task: 'sendReport', campaignId: 'abc' }, function () { console.log('job registered'); }); }, 3000); } catch (Exception) { console.log('Exception', Exception); }
scheduler.on('my-job', function (params) { if (params.task == 'sendReport') { // send campaign email // sendEmailCampaign(params.campaignId); } });`