add obj export
This commit is contained in:
parent
5bb0cd327f
commit
7ea66a9e7b
6 changed files with 91 additions and 38 deletions
|
|
@ -86,12 +86,13 @@ const dispatch = moto.worker = {
|
|||
if (run) {
|
||||
try {
|
||||
let data = run(msg.data, send);
|
||||
if (data || async === false) {
|
||||
if (!done && (data || async === false)) {
|
||||
send.done(data);
|
||||
}
|
||||
} catch (error) {
|
||||
console.trace(error.stack);
|
||||
dispatch.send({ data: {error: error.toString()}, done: true });
|
||||
send.error(error.toString());
|
||||
// dispatch.send({ data: {error: error.toString()}, done: true });
|
||||
}
|
||||
} else {
|
||||
console.log({worker_unhandled: e});
|
||||
|
|
|
|||
Loading…
Reference in a new issue