Closed 67726e closed 2 years ago
One can manually add the then
and catch
to manually update the job status, however support for these functions is a state feature of the 4.0 release so I'm not sure if I'm just not doing something right here?
// ./jobs/state/index.js
export const transitionState = async function(request) {
return await new StateTransitionJob(request).run()
.then(() => this.success())
.catch(() => this.failure());
};
20210325-22:16:42.035(-4)? ****
I20210325-22:16:42.035(-4)? Jobs: Job has failed: transitionState, ftajf4yFrtHZ3iwQh
I20210325-22:16:42.035(-4)? Jobs: Queue was stopped; please correct your job function and restart the server
I20210325-22:16:42.036(-4)? ****
Looking at your most recent commit, there appears to be a mismatch between expectations of the function's name vs. practice:
console.log('Name:', transitionState.constructor.name);
Name: Function
same error here. It looks 3.1.1 do not have this bug.
Looking at your most recent commit, there appears to be a mismatch between expectations of the function's name vs. practice:
console.log('Name:', transitionState.constructor.name);
Name: Function
3db5623#diff-501cf71c87bf08799812e67f523688ad62a947e90288368f53dffc1952b37e8b
So how to fix that?
@weilitao Personally, I haven't bothered using this library. I found, https://github.com/wildhart/meteor.jobs, a much more thought-out library with a responsive, helpful, and friendly author.
@weilitao Personally, I haven't bothered using this library. I found, https://github.com/wildhart/meteor.jobs, a much more thought-out library with a responsive, helpful, and friendly author.
Thanks. I'll check that library.
Hey folks - this has been fixed in the new version
Currently running into issues with the async / await support around job failures.
Environment:
Example:
The expected result would be a job in the
failure
state, however it appears in thesuccess
state.The results I see in the CLI: