|
|
@ -40,7 +40,7 @@ module.exports = (_options = {}) => { |
|
|
|
|
|
|
|
|
|
|
|
const startJob = ({ id: jobId, action, payload }) => ( |
|
|
|
const startJob = ({ id: jobId, action, payload }) => ( |
|
|
|
new Promise((resolve, reject) => { |
|
|
|
new Promise((resolve, reject) => { |
|
|
|
log(`[${id}]: Start ${jobId}, action=${action}, payload=`, payload); |
|
|
|
log(`[${id}]: Start ${jobId}, action=${action}`); |
|
|
|
setResolve(action, resolve); |
|
|
|
setResolve(action, resolve); |
|
|
|
setReject(action, reject); |
|
|
|
setReject(action, reject); |
|
|
|
send(worker, { |
|
|
|
send(worker, { |
|
|
@ -119,7 +119,7 @@ module.exports = (_options = {}) => { |
|
|
|
workerId, jobId, status, action, data, |
|
|
|
workerId, jobId, status, action, data, |
|
|
|
}) => { |
|
|
|
}) => { |
|
|
|
if (status === 'resolve') { |
|
|
|
if (status === 'resolve') { |
|
|
|
log(`[${workerId}]: Complete ${jobId}, data=`, data); |
|
|
|
log(`[${workerId}]: Complete ${jobId}`); |
|
|
|
let d = data; |
|
|
|
let d = data; |
|
|
|
if (action === 'recognize') { |
|
|
|
if (action === 'recognize') { |
|
|
|
d = circularize(data); |
|
|
|
d = circularize(data); |
|
|
|