Fix/plugin workflow migration (#3404)
* fix(plugin-workflow): fix migration * fix(plugin-workflow): add job.nodeKey when saving
This commit is contained in:
parent
8d06b73c48
commit
a4b9544944
@ -91,6 +91,7 @@ export default class extends Instruction {
|
||||
status: JOB_STATUS.PENDING,
|
||||
result: null,
|
||||
nodeId: node.id,
|
||||
nodeKey: node.key,
|
||||
upstreamId: prevJob?.id ?? null,
|
||||
});
|
||||
job.node = node;
|
||||
|
@ -32,6 +32,7 @@ export default class extends Instruction {
|
||||
// save loop index
|
||||
result: 0,
|
||||
nodeId: node.id,
|
||||
nodeKey: node.key,
|
||||
upstreamId: prevJob?.id ?? null,
|
||||
});
|
||||
|
||||
|
@ -99,6 +99,7 @@ export default class extends Instruction {
|
||||
status: JOB_STATUS.PENDING,
|
||||
result: mode ? [] : null,
|
||||
nodeId: node.id,
|
||||
nodeKey: node.key,
|
||||
upstreamId: prevJob?.id ?? null,
|
||||
});
|
||||
|
||||
|
@ -61,6 +61,7 @@ export default class extends Instruction {
|
||||
status: JOB_STATUS.PENDING,
|
||||
result: Array(branches.length).fill(null),
|
||||
nodeId: node.id,
|
||||
nodeKey: node.key,
|
||||
upstreamId: prevJob?.id ?? null,
|
||||
});
|
||||
|
||||
|
@ -44,6 +44,7 @@ export default class extends Instruction {
|
||||
const job = await processor.saveJob({
|
||||
status: JOB_STATUS.PENDING,
|
||||
nodeId: node.id,
|
||||
nodeKey: node.key,
|
||||
upstreamId: prevJob?.id ?? null,
|
||||
});
|
||||
|
||||
|
@ -139,6 +139,7 @@ export default class Processor {
|
||||
if (!(job instanceof Model)) {
|
||||
job.upstreamId = prevJob instanceof Model ? prevJob.get('id') : null;
|
||||
job.nodeId = node.id;
|
||||
job.nodeKey = node.key;
|
||||
}
|
||||
const savedJob = await this.saveJob(job);
|
||||
|
||||
@ -222,8 +223,7 @@ export default class Processor {
|
||||
}
|
||||
this.jobsMap.set(job.id, job);
|
||||
|
||||
const node = this.nodesMap.get(job.nodeId);
|
||||
this.jobsMapByNodeKey[node.key] = job.result;
|
||||
this.jobsMapByNodeKey[job.nodeKey] = job.result;
|
||||
|
||||
return job;
|
||||
}
|
||||
|
@ -152,6 +152,7 @@ export class ConditionInstruction extends Instruction {
|
||||
result,
|
||||
// TODO(optimize): try unify the building of job
|
||||
nodeId: node.id,
|
||||
nodeKey: node.key,
|
||||
upstreamId: (prevJob && prevJob.id) || null,
|
||||
};
|
||||
|
||||
|
@ -20,7 +20,7 @@ export default class extends Migration {
|
||||
}
|
||||
return job.update(
|
||||
{
|
||||
nodeKey: job.node.key,
|
||||
nodeKey: job.node?.key,
|
||||
},
|
||||
{
|
||||
silent: true,
|
||||
|
Loading…
Reference in New Issue
Block a user