Closed LucianoVandi closed 5 years ago
Can you check if the job is failing?
I suspect passing in error
param from the catch
statement is what's messing it up. Maybe you need to pass error.stack
job.failure(error.stack);
@msavin Yes is failing. I've update the job.failure with error.stack but the issue remain. I don't understand how it's reaching the catch block if everything seems work in the try block. I'm already calling job.success(result)
if I got a result from sales.insertSQL(data)
and doing console.log of the result confirm that. It looks weird...
@msavin Think i've found it. The error is thrown from job.success(result)
, where result is the set by await sale.insertSQL()
. This method simply wrap Sequelize static create()
that should return an object. This is an example of result:
OrderDetail {
dataValues:
{ ... },
_previousDataValues:
{ ... },
_changed:
{ ... },
_modelOptions:
{ ...
sequelize:
Sequelize { ... },
hooks: {} },
_options:
{ ... },
isNewRecord: false,
null: null
}
@msavin maybe this issue should be closed. In fact the data I'm trying to pass to job.success()
is not an object but an instance of OrderDetail model. Thanks for support and for the awesome work!
Hi there and thanks for the great work you did with the package. I'm trying to replace vsivsi:job-collection in a Meteor project but when I run jobs I get the following error:
This happens even if the job complete it's work. I'm using Meteor 1.8.1
This is the job code:
The try block is executed without errors and the code reach the
job.success(result)
part, but then it catch the error shown above making the job fail.I call
Jobs.run("writeToSQL")
inside a Meteor Method. I think I'm doing something wrong but can't get what... -_-