Skip to content

Commit

Permalink
changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Abhinav Gautam authored and Abhinav Gautam committed Oct 8, 2024
1 parent da40c0a commit 4925526
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
6 changes: 2 additions & 4 deletions src/routes/queue-route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,11 @@ router.post("/pdf", async (req: Request, res: Response) => {
}

if(job) {
let state = await job.getState()
let response: response = job.returnvalue;
res.download(response.path);
} else {
throw new Error("Some Error Occurred While Queueing")
}

throw new Error("Some Error Occurred While Queueing")

} catch (err ) {
res.json({
success: false,
Expand Down
13 changes: 10 additions & 3 deletions src/utils/sandbox_worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,16 @@ module.exports = async (job: SandboxedJob) => {
);

if(payload.otherPageFunctions) {
for(let fn of Object.keys(payload.otherPageFunctions)) {
// @ts-ignore
await page[fn](...payload.otherPageFunctions[fn])
for(let fn of payload.otherPageFunctions) {

if(fn.length>0) {
// @ts-ignore
await page[fn[0]](...fn[1])
} else {
// @ts-ignore
await page[fn[0]]()
}

}
}

Expand Down

0 comments on commit 4925526

Please sign in to comment.