|
|
@ -123,7 +123,7 @@ export class JobsController implements OnModuleInit { |
|
|
|
this.closedJobs.push(jobId); |
|
|
|
this.closedJobs.push(jobId); |
|
|
|
setTimeout(() => { |
|
|
|
setTimeout(() => { |
|
|
|
this.closedJobs = this.closedJobs.filter((j) => j !== jobId); |
|
|
|
this.closedJobs = this.closedJobs.filter((j) => j !== jobId); |
|
|
|
}, POLLING_INTERVAL * 1.5); |
|
|
|
}, POLLING_INTERVAL * 2); |
|
|
|
} |
|
|
|
} |
|
|
|
break; |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
@ -184,10 +184,9 @@ export class JobsController implements OnModuleInit { |
|
|
|
response = { |
|
|
|
response = { |
|
|
|
status: 'update', |
|
|
|
status: 'update', |
|
|
|
data, |
|
|
|
data, |
|
|
|
_mid: this.localJobs[jobId]._mid, |
|
|
|
_mid: ++this.localJobs[jobId]._mid, |
|
|
|
}; |
|
|
|
}; |
|
|
|
this.localJobs[jobId].messages.push(response); |
|
|
|
this.localJobs[jobId].messages.push(response); |
|
|
|
this.localJobs[jobId]._mid += 1; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// limit to 20 messages
|
|
|
|
// limit to 20 messages
|
|
|
|
if (this.localJobs[jobId].messages.length > 20) { |
|
|
|
if (this.localJobs[jobId].messages.length > 20) { |
|
|
@ -233,13 +232,13 @@ export class JobsController implements OnModuleInit { |
|
|
|
this.closedJobs.push(jobId); |
|
|
|
this.closedJobs.push(jobId); |
|
|
|
setTimeout(() => { |
|
|
|
setTimeout(() => { |
|
|
|
this.closedJobs = this.closedJobs.filter((j) => j !== jobId); |
|
|
|
this.closedJobs = this.closedJobs.filter((j) => j !== jobId); |
|
|
|
}, POLLING_INTERVAL * 1.5); |
|
|
|
}, POLLING_INTERVAL * 2); |
|
|
|
|
|
|
|
|
|
|
|
setTimeout(() => { |
|
|
|
setTimeout(() => { |
|
|
|
delete this.jobRooms[jobId]; |
|
|
|
delete this.jobRooms[jobId]; |
|
|
|
delete this.localJobs[jobId]; |
|
|
|
delete this.localJobs[jobId]; |
|
|
|
NocoCache.del(`${CacheScope.JOBS}:${jobId}:messages`); |
|
|
|
NocoCache.del(`${CacheScope.JOBS}:${jobId}:messages`); |
|
|
|
}, POLLING_INTERVAL); |
|
|
|
}, POLLING_INTERVAL * 2); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -253,11 +252,10 @@ export class JobsController implements OnModuleInit { |
|
|
|
response = { |
|
|
|
response = { |
|
|
|
status: 'update', |
|
|
|
status: 'update', |
|
|
|
data, |
|
|
|
data, |
|
|
|
_mid: this.localJobs[jobId]._mid, |
|
|
|
_mid: ++this.localJobs[jobId]._mid, |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
this.localJobs[jobId].messages.push(response); |
|
|
|
this.localJobs[jobId].messages.push(response); |
|
|
|
this.localJobs[jobId]._mid += 1; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// limit to 20 messages
|
|
|
|
// limit to 20 messages
|
|
|
|
if (this.localJobs[jobId].messages.length > 20) { |
|
|
|
if (this.localJobs[jobId].messages.length > 20) { |
|
|
|