Skip to content

Commit

Permalink
feat(stepfunctions-tasks): await the eval so async ops can be passed …
Browse files Browse the repository at this point in the history
…to tasks.EvaluateExpression (aws#16290)

Currently the way `EvaluateExpression` is set up, if you pass an async expression to it, it never waits for the execution to complete. By adding an `await` before the `eval()` call, async ops can be passed in. This also works for sync ops same as before (await works with sync code as well).

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
  • Loading branch information
3p3r authored and TikiTDO committed Sep 6, 2021
1 parent 6a542bc commit 5d8ba9c
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ export async function handler(event: Event): Promise<any> {
);
console.log(`Expression: ${expression}`);

return eval(expression);
return await eval(expression);
}

0 comments on commit 5d8ba9c

Please sign in to comment.