launchdarkly / node-server-sdk

LaunchDarkly Server-side SDK for Node
Other
79 stars 65 forks source link

await on client.close() #268

Closed lepirlouit closed 1 year ago

lepirlouit commented 1 year ago

Describe the bug page : https://docs.launchdarkly.com/guides/infrastructure/aws-lambda#flushing-events The documentation says to await on client.close() but this seems not to be a promise, so await it not needed but it also says that close will call client.flush() which is a promise. should client.close() be an async function and wait on the flush ?

SDK version 7.0.0

Language version, developer tools node --version v16.19.0

OS/platform Ubuntu 22.04

louis-launchdarkly commented 1 year ago

Hello @lepirlouit, thank you for reaching out with this question. We will look into this.

Filed internally as 188179.

kinyoklion commented 1 year ago

@lepirlouit This is an issue with the documentation and we will get it resolved. In many SDKs close will flush pending events, but in the node SDK it does not. It just releases resources. In this case primarily it stops all the interval work being done and disconnects from LD.

If you want to make sure events are flushed, then you should await the flush, and then close the client.

Thank you, Ryan

github-actions[bot] commented 1 year ago

This issue is marked as stale because it has been open for 30 days without activity. Remove the stale label or comment, or this will be closed in 7 days.