mirror of
https://github.com/OneUptime/oneuptime
synced 2024-11-22 07:10:53 +00:00
Fix async/await issue in VM.ts
This commit is contained in:
parent
f38d8ae452
commit
8282669fbd
@ -44,7 +44,7 @@ router.post(
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
result.returnValue = await result.returnValue;
|
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
logger.error(err);
|
logger.error(err);
|
||||||
throw new BadDataException((err as Error).message);
|
throw new BadDataException((err as Error).message);
|
||||||
|
@ -42,7 +42,7 @@ export default class VMUtil {
|
|||||||
${code}
|
${code}
|
||||||
})()` || '';
|
})()` || '';
|
||||||
|
|
||||||
const returnVal: any = vm.runInContext(script, sandbox, {
|
const returnVal: any = await vm.runInContext(script, sandbox, {
|
||||||
timeout: options.timeout || 5000,
|
timeout: options.timeout || 5000,
|
||||||
}); // run the script
|
}); // run the script
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user