Fixed Cancel/Delete Bug
This commit is contained in:
parent
204bcbb7c1
commit
d5ea0981e5
5 changed files with 77 additions and 25 deletions
|
@ -17,6 +17,7 @@ export default class Initiator {
|
|||
(() => {
|
||||
console.log("job pipeline closed");
|
||||
});
|
||||
this.sk = null;
|
||||
}
|
||||
|
||||
async newJob(jobRequest, onLog, onClose, onCreate) {
|
||||
|
@ -26,11 +27,11 @@ export default class Initiator {
|
|||
onLog = onLog ?? this.onLog.bind(this);
|
||||
onClose = onClose ?? this.onClose.bind(this);
|
||||
onCreate = onCreate ?? this.onCreate.bind(this);
|
||||
const sk = mgr.socket("/");
|
||||
sk.on(events.JOB_LOG, onLog);
|
||||
sk.on(events.JOB_CLS, onClose);
|
||||
this.sk = mgr.socket("/");
|
||||
this.sk.on(events.JOB_LOG, onLog);
|
||||
this.sk.on(events.JOB_CLS, onClose);
|
||||
return new Promise((res) =>
|
||||
sk.on(events.JOB_CRT, function onJobCreate(id) {
|
||||
this.sk.on(events.JOB_CRT, function onJobCreate(id) {
|
||||
onCreate(id);
|
||||
res({ ...jobRequest, id });
|
||||
})
|
||||
|
@ -78,13 +79,13 @@ export default class Initiator {
|
|||
);
|
||||
});
|
||||
onPipelineClose = onPipelineClose ?? this.onPipelineClose.bind(this);
|
||||
const sk = mgr.socket("/");
|
||||
sk.on(events.JOB_LOG, onLog);
|
||||
sk.on(events.JOB_CLS, onClose);
|
||||
sk.on(events.PPL_TRG, onPipelineTrigger);
|
||||
sk.on(events.PPL_CLS, onPipelineClose);
|
||||
this.sk = mgr.socket("/");
|
||||
this.sk.on(events.JOB_LOG, onLog);
|
||||
this.sk.on(events.JOB_CLS, onClose);
|
||||
this.sk.on(events.PPL_TRG, onPipelineTrigger);
|
||||
this.sk.on(events.PPL_CLS, onPipelineClose);
|
||||
return new Promise((res) =>
|
||||
sk.on(events.JOB_CRT, function onJobCreate(id) {
|
||||
this.sk.on(events.JOB_CRT, function onJobCreate(id) {
|
||||
onCreate(id);
|
||||
res({ ...jobRequest, id });
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue