Skip to content

Commit f4c6fa5

Browse files
committed
Error handling in blueapi submit plan and tidy ups
1 parent 9276338 commit f4c6fa5

File tree

1 file changed

+0
-20
lines changed

1 file changed

+0
-20
lines changed

src/blueapi/blueapi.ts

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -66,16 +66,6 @@ export function getWorkerStatus(): Promise<BlueApiWorkerState> {
6666
return blueApiCall("/worker/state").then((res) => res.json());
6767
}
6868

69-
export function submitPlan(
70-
planName: string,
71-
planParams: object
72-
): Promise<string> {
73-
return blueApiCall("/tasks", "POST", {
74-
name: planName,
75-
params: planParams,
76-
}).then((res) => res.json().then((res) => res["task_id"]));
77-
}
78-
7969
// Note. fetch only rejects a promise on network errors, but http errors
8070
// must be caught by checking the response
8171
export function submitTask(
@@ -116,16 +106,6 @@ export function submitAndRunPlanImmediately(
116106
})
117107
.catch((error) => console.log(error));
118108
}
119-
// return submitPlan(planName, planParams)
120-
// .then((res) =>
121-
// // TODO make sure submitPlan was succesful before then putting it to the worker
122-
// // See https://github.com/DiamondLightSource/mx-daq-ui/issues/17
123-
// blueApiCall("/worker/task", "PUT", { task_id: res }).then((res) =>
124-
// res.json().then((res) => res["task_id"])
125-
// )
126-
// )
127-
// .catch((error) => console.log(error));
128-
// }
129109

130110
export function abortCurrentPlan(): Promise<BlueApiWorkerState> {
131111
return blueApiCall("/worker/state", "PUT", {

0 commit comments

Comments
 (0)