aws-samples / aws-samples/amazon-elasticsearch-lambda-samples

context.succeed would be called multiple times

Open
#7 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
386
Forks
170
PR merge metrics
No merged PRs in 30d

Description

I'm a little confused how the `kinesis_lambda_es.js` example is supposed to work. [Documentation says](http://docs.aws.amazon.com/lambda/latest/dg/nodejs-prog-model-using-old-runtime.html#nodejs-prog-model-context-methods-succeed) that context.succeed, when called, will terminate the lambda.

However, the example [would call context.succeed](https://github.com/awslabs/amazon-elasticsearch-lambda-samples/blob/master/src/kinesis_lambda_es.js#L73) for every HTTP response callback of AWS ElasticSearch. Which is correct? These two sources seem to contradict each other. If the docs.aws.amazon.com site is correct, then wouldn't the context.succeed callback need to occur after ALL ES calls had their callbacks called?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.