Closed tomasinouk closed 5 years ago
OK, sort it out. Not my brightest moment.
leaving comment for further reference.
both Jobs.register
and Jobs.run
need to run on the server. So when in documentation it said run it like Meteor Method, it is meant literally.
Need to create a Meteor Method, which will run the job.
eg. server.js
Jobs.register({
sayHi: function(name) {
console.log("Hi " + name)
this.success()
})
Meteor.methods({
runJob() {
console.info('calling Job to run server ...')
Jobs.run('sayHi', 'BAD BAD ROBOT')
}
})
client
methods: {
callJob() {
console.info("calling Job to run client ...");
Meteor.call("runJob");
// Jobs.run("sendReminder", "BAD BAD ROBOT"); // this does not belong here
}
}
hope nobody will need this
hi, I am having an issue with probably
Job.register
, whereI am getting an error
When I do
Jobs.run
I am trying the simple example from doco with in my
server.js
and then
I can see a mongoDB collection
job_data
without any records though. Any idea, where the problem might be? Thank you