1

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 ?

Caal Saal VI
  • 192
  • 2
  • 12

1 Answers1

2

You need to set context.callbackWaitsForEmptyEventLoop = false in your Lambda function so that Lambda will properly shut down when using DAX.

Jeff Hardy
  • 7,632
  • 24
  • 24