Skip to content

Commit d78ca60

Browse files
authored
fix(comms): add "recover" function in ecl/workunit (#4619)
* expose a "recover" convenience function in ecl/workunit * fix the flags passed to WUResubmit by the "resubmit" function Signed-off-by: Jeremy Clements <79224539+jeclrsg@users.noreply.github.com>
1 parent 805ebe6 commit d78ca60

1 file changed

Lines changed: 14 additions & 1 deletion

File tree

packages/comms/src/ecl/workunit.ts

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -548,7 +548,7 @@ export class Workunit extends StateObject<UWorkunitState, IWorkunitState> implem
548548
return this.WUAction(WsWorkunits.ECLWUActions.Reschedule);
549549
}
550550

551-
resubmit(): Promise<Workunit> {
551+
recover(): Promise<Workunit> {
552552
return this.WUResubmit({
553553
CloneWorkunit: false,
554554
ResetWorkflow: false
@@ -561,6 +561,19 @@ export class Workunit extends StateObject<UWorkunitState, IWorkunitState> implem
561561
});
562562
}
563563

564+
resubmit(): Promise<Workunit> {
565+
return this.WUResubmit({
566+
CloneWorkunit: false,
567+
ResetWorkflow: true
568+
}).then(() => {
569+
this.clearState(this.Wuid);
570+
return this.refresh().then(() => {
571+
this._monitor();
572+
return this;
573+
});
574+
});
575+
}
576+
564577
clone(): Promise<Workunit> {
565578
return this.WUResubmit({
566579
CloneWorkunit: true,

0 commit comments

Comments
 (0)