passing an extra parameter in jobschedule in node.js
Posted
by
Sush
on Stack Overflow
See other posts from Stack Overflow
or by Sush
Published on 2013-10-31T09:25:51Z
Indexed on
2013/11/07
3:55 UTC
Read the original article
Hit count: 162
JavaScript
|node.js
Is there any possible way to pass any extra parameter instead of date
in schedule.scheduleJob(date,function(id))
The below code is not working
var id =record.id;
var date =record.date;
jobsCollection.save({
id: record.id
}, {
$set: record
}, function (err, result) {
var j = schedule.scheduleJob(date, function (id) {
return function () {
console.log("inside----------")
console.log(id)
};
}(id));
if (!err) {
return context.sendJson([], 404);;
}
});
i want to pass the date along with another data to schedule jobs. so that i can perform other operations based on the date schedul
e and that id
© Stack Overflow or respective owner