Skip to content

Commit d71305f

Browse files
committed
stopPipeline
1 parent 2f1fd5f commit d71305f

File tree

2 files changed

+13
-8
lines changed

2 files changed

+13
-8
lines changed

services/static-webserver/client/source/class/osparc/data/Resources.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -341,6 +341,10 @@ qx.Class.define("osparc.data.Resources", {
341341
method: "POST",
342342
url: statics.API + "/computations/{studyId}:start"
343343
},
344+
stopPipeline: {
345+
method: "POST",
346+
url: statics.API + "/computations/{studyId}:stop"
347+
},
344348
}
345349
},
346350
"jobsActive": {

services/static-webserver/client/source/class/osparc/desktop/StudyEditor.js

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -666,15 +666,16 @@ qx.Class.define("osparc.desktop.StudyEditor", {
666666
},
667667

668668
__requestStopPipeline: function(studyId) {
669-
const url = "/computations/" + encodeURIComponent(studyId) + ":stop";
670-
const req = new osparc.io.request.ApiRequest(url, "POST");
671-
req.addListener("success", () => this.getStudyLogger().debug(null, "Pipeline aborting"), this);
672-
req.addListener("error", () => this.getStudyLogger().error(null, "Error stopping pipeline"), this);
673-
req.addListener("fail", () => this.getStudyLogger().error(null, "Failed stopping pipeline"), this);
674-
req.send();
675-
676669
this.getStudyLogger().info(null, "Stopping pipeline");
677-
return true;
670+
671+
const params = {
672+
url: {
673+
"studyId": studyId
674+
},
675+
};
676+
osparc.data.Resources.fetch("runPipeline", "stopPipeline", params)
677+
.then(() => this.getStudyLogger().debug(null, "Pipeline aborting"), this)
678+
.catch(() => this.getStudyLogger().error(null, "Error stopping pipeline"), this);
678679
},
679680
// ------------------ START/STOP PIPELINE ------------------
680681

0 commit comments

Comments
 (0)