Skip to content

Commit

Permalink
fix: local dev env lambda return value
Browse files Browse the repository at this point in the history
  • Loading branch information
mvayngrib committed Oct 4, 2018
1 parent 79e93a5 commit bb1ebe6
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/lambda.ts
Original file line number Diff line number Diff line change
Expand Up @@ -664,11 +664,13 @@ Previous exit stack: ${this.lastExitStack}`)
const promise = this.preProcess({ event, context })
.then(() => this.run())

if (this.isLocal) return promise

// until issue is resolved, avoid returning a promise:
// https://github.com/aws/aws-xray-sdk-node/issues/27#issuecomment-380092859
promise.then(result => context.done(null, result), context.done)
if (context.done) {
// until issue is resolved, avoid returning a promise:
// https://github.com/aws/aws-xray-sdk-node/issues/27#issuecomment-380092859
promise.then(result => context.done(null, result), context.done)
} else {
return promise
}
}
}

Expand Down

0 comments on commit bb1ebe6

Please sign in to comment.