Skip to content

Commit 3dd65fa

Browse files
committed
frontend/latex: fix async_call
1 parent 2d84f22 commit 3dd65fa

File tree

5 files changed

+53
-93
lines changed

5 files changed

+53
-93
lines changed

src/packages/frontend/frame-editors/latex-editor/knitr.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ export async function knitr(
6565
async_stats: true,
6666
});
6767
if (output.type !== "async") {
68-
throw new Error("output is not an async job");
68+
throw new Error("output: not an async task");
6969
}
7070
set_job_info(output);
7171
return output;

src/packages/frontend/frame-editors/latex-editor/latexmk.ts

-4
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,6 @@ export async function latexmk(
6060
throw new Error("Unable to spawn LaTeX compile job.");
6161
}
6262

63-
if (job_info.type !== "async") {
64-
throw new Error("not an async job");
65-
}
66-
6763
// Step 1: Wait for the launched job to finish
6864
let output: BuildLog;
6965
while (true) {

src/packages/frontend/frame-editors/latex-editor/pythontex.ts

+1
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ export async function pythontex(
5454
path: output_directory || directory,
5555
err_on_exit: false,
5656
aggregate,
57+
async_call: true,
5758
});
5859

5960
if (job_info.type !== "async") {

src/packages/frontend/frame-editors/latex-editor/sagetex.ts

+5-4
Original file line numberDiff line numberDiff line change
@@ -66,13 +66,14 @@ export async function sagetex(
6666
path: output_directory || directory,
6767
err_on_exit: false,
6868
aggregate: hash ? { value: hash } : undefined,
69+
async_call: true,
6970
});
7071

7172
if (job_info.type !== "async") {
7273
throw new Error("not an async job");
7374
}
7475

75-
set_job_info(job_info)
76+
set_job_info(job_info);
7677

7778
while (true) {
7879
try {
@@ -83,10 +84,10 @@ export async function sagetex(
8384
async_stats: true,
8485
});
8586
if (output.type !== "async") {
86-
throw new Error("output type is not async exec")
87+
throw new Error("output type is not async exec");
8788
}
88-
set_job_info(output)
89-
return output
89+
set_job_info(output);
90+
return output;
9091
} catch (err) {
9192
if (err === TIMEOUT_CALLING_PROJECT) {
9293
// this will be fine, hopefully. We continue trying to get a reply.

0 commit comments

Comments
 (0)