Skip to content

Commit

Permalink
fixed issues
Browse files Browse the repository at this point in the history
  • Loading branch information
inlife committed Oct 12, 2024
1 parent 1387723 commit 3c36eb8
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions packages/nexrender-worker/src/instance.js
Original file line number Diff line number Diff line change
Expand Up @@ -163,24 +163,24 @@ const createWorker = () => {
}

try {
currentJob.onRenderProgress = (currentJob) => {
currentJob.onRenderProgress = ((c, s) => (job) => {
try {
/* send render progress to our server */
client.updateJob(currentJob.uid, getRenderingStatus(currentJob));
c.updateJob(job.uid, getRenderingStatus(job));

if (settings.onRenderProgress) {
settings.onRenderProgress(currentJob);
if (s.onRenderProgress) {
s.onRenderProgress(job);
}
} catch (err) {
if (settings.stopOnError) {
if (s.stopOnError) {
throw err;
} else {
console.log(`[${currentJob.uid}] error occurred: ${err.stack}`)
console.log(`[${currentJob.uid}] render proccess stopped with error...`)
console.log(`[${currentJob.uid}] continue listening next job...`)
console.log(`[${job.uid}] error occurred: ${err.stack}`)
console.log(`[${job.uid}] render proccess stopped with error...`)
console.log(`[${job.uid}] continue listening next job...`)
}
}
}
})(client, settings);

currentJob.onRenderError = (currentJob, err /* on render error */) => {
currentJob.error = [].concat(currentJob.error || [], [err.toString()]);
Expand Down

0 comments on commit 3c36eb8

Please sign in to comment.