|
|
@ -19,7 +19,7 @@ export class JobsEventService { |
|
|
|
|
|
|
|
|
|
|
|
@OnQueueActive() |
|
|
|
@OnQueueActive() |
|
|
|
onActive(job: Job) { |
|
|
|
onActive(job: Job) { |
|
|
|
if (process.env['NC_WORKER_CONTAINER']) { |
|
|
|
if (process.env.NC_WORKER_CONTAINER === 'true') { |
|
|
|
this.jobsRedisService.publish(`jobs-${job.id.toString()}`, { |
|
|
|
this.jobsRedisService.publish(`jobs-${job.id.toString()}`, { |
|
|
|
cmd: JobEvents.STATUS, |
|
|
|
cmd: JobEvents.STATUS, |
|
|
|
id: job.id.toString(), |
|
|
|
id: job.id.toString(), |
|
|
@ -46,7 +46,7 @@ export class JobsEventService { |
|
|
|
), |
|
|
|
), |
|
|
|
); |
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
if (process.env['NC_WORKER_CONTAINER']) { |
|
|
|
if (process.env.NC_WORKER_CONTAINER === 'true') { |
|
|
|
this.jobsRedisService.publish(`jobs-${job.id.toString()}`, { |
|
|
|
this.jobsRedisService.publish(`jobs-${job.id.toString()}`, { |
|
|
|
cmd: JobEvents.STATUS, |
|
|
|
cmd: JobEvents.STATUS, |
|
|
|
id: job.id.toString(), |
|
|
|
id: job.id.toString(), |
|
|
@ -73,7 +73,7 @@ export class JobsEventService { |
|
|
|
|
|
|
|
|
|
|
|
@OnQueueCompleted() |
|
|
|
@OnQueueCompleted() |
|
|
|
onCompleted(job: Job, data: any) { |
|
|
|
onCompleted(job: Job, data: any) { |
|
|
|
if (process.env['NC_WORKER_CONTAINER']) { |
|
|
|
if (process.env.NC_WORKER_CONTAINER === 'true') { |
|
|
|
this.jobsRedisService.publish(`jobs-${job.id.toString()}`, { |
|
|
|
this.jobsRedisService.publish(`jobs-${job.id.toString()}`, { |
|
|
|
cmd: JobEvents.STATUS, |
|
|
|
cmd: JobEvents.STATUS, |
|
|
|
id: job.id.toString(), |
|
|
|
id: job.id.toString(), |
|
|
@ -96,7 +96,7 @@ export class JobsEventService { |
|
|
|
|
|
|
|
|
|
|
|
@OnEvent(JobEvents.LOG) |
|
|
|
@OnEvent(JobEvents.LOG) |
|
|
|
onLog(data: { id: string; data: { message: string } }) { |
|
|
|
onLog(data: { id: string; data: { message: string } }) { |
|
|
|
if (process.env['NC_WORKER_CONTAINER']) { |
|
|
|
if (process.env.NC_WORKER_CONTAINER === 'true') { |
|
|
|
this.jobsRedisService.publish(`jobs-${data.id}`, { |
|
|
|
this.jobsRedisService.publish(`jobs-${data.id}`, { |
|
|
|
cmd: JobEvents.LOG, |
|
|
|
cmd: JobEvents.LOG, |
|
|
|
id: data.id, |
|
|
|
id: data.id, |
|
|
|