I trying to use DAX with dynogels but it just stuck there until my lambda timeout when I do the scan()
.
Here how I initialize the DAX.
import AmazonDaxClient from 'amazon-dax-client';
const dax = new AmazonDaxClient({endpoints: [env.Endpoint], region: 'us-west-2'});
const docClient = new dynogels.AWS.DynamoDB.DocumentClient({service: dax});
dynogels.documentClient(docClient)
When I do Model.scan()
it just processing until timeout without any error.
Is it the correct way to init DAX for dynogels ?
You need to set context.callbackWaitsForEmptyEventLoop = false
in your Lambda function so that Lambda will properly shut down when using DAX.