Skip to content

Commit

Permalink
refactor: dont return result of resolver function
Browse files Browse the repository at this point in the history
  • Loading branch information
dnalborczyk committed Nov 30, 2022
1 parent 6be0a1b commit d0cba92
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/lambda/handler-runner/python-runner/PythonRunner.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ export default class PythonRunner {
// invoke.py, based on:
// https://github.com/serverless/serverless/blob/v1.50.0/lib/plugins/aws/invokeLocal/invoke.py
async run(event, context) {
return new Promise((accept, reject) => {
return new Promise((res, rej) => {
const input = stringify({
context,
event,
Expand All @@ -117,11 +117,10 @@ export default class PythonRunner {
if (parsed) {
this.#handlerProcess.stdout.readline.removeListener('line', onLine)
this.#handlerProcess.stderr.removeListener('data', onErr)
return accept(parsed)
res(parsed)
}
return null
} catch (err) {
return reject(err)
rej(err)
}
}

Expand Down

0 comments on commit d0cba92

Please sign in to comment.