I’m working on a Slack bot. I’m using a model to get data from the user and using two functions (lambdas) to schedule events based on the data provided by the user, however every time I hit the submit button for the model, I get the following error: “We had some problems connecting.” Try again? ), and I believe this is happening because two lambda functions are being called simultaneously, causing the computing to take longer than 3 seconds to complete. Since calling both lambda functions simultaneously is necessary, how can I do this without encountering any errors?
I’m using javascript.
if (isPermission) {
let privacy = setPrivacy(employee_id, bdDate, orgId, anniDate, DOB, BYear, token);
let invokeAnni = Invoke(employee_id, orgId, Empinfo[0].Employee.firstName, action1, anniDate, Local, payloadData.user.id);
let a = Invoking(employee_id, orgId, bdDate, Empinfo[0].Employee.firstName, action, Local, payloadData.user.id);
let update = botreply(payloadData.user.id);
flag = 0;
await privacy;
await invokeAnni;
await a;
await update;
return {
statusCode:200
}
}
else {
let privacy = setPrivacy(employee_id, bdDate, orgId, anniDate, DOB, BYear, token);
flag = 0;
await privacy;
return {
statusCode:200
}
}
invoke and invoking are two lambda function which i’m calling simultaneously.