serverless-api-example
serverless-api-example copied to clipboard
Is it intentional that the ddb client is never closed?
It looks like the Init() in users is being called once when the service is started. Which seems to create one client, which is never closed, but is just re-used for all future hits on the route.
Is this intended?
I had expected the client to be created on demand, and then released when finished.
I'm new to go, and interested in understanding this implementation.
Hmm let's do some digging!
Client as in the AWS client? The DynamoDB client?
the dynamo client. in other code examples I have seen typically you defer closing the client once you're done with it. in your code it seems you're never done with the client, it just remains available for future calls to each endpoint.