Getting timeout while implementation server method invocation

Functionality
On server end, I have written a method which uses JSForce Library for salesforce integration. I believe when method is invoked, JSforce library makes a API call.

I am invoking server method from front end app for which I am getting {“status”: 504,“message”: “Timeout error while processing the request.”,“errorSource”: “APP” } on Freshservice development instance. The app is working fine on Local instance.

manifest.json
{
“platform-version”: “2.3”,
“product”: {
“freshservice”: {
“location”: {
“full_page_app”: {
“url”: “index.html”,
“icon”: “styles/images/icon.svg”
}
},
“functions”: {
“getAccountContracts”: {
“timeout”: 20
}
}
}
},
“engines”: {
“node”: “18.10.0”,
“fdk”: “9.0.5”
},
“dependencies”: {
“jsforce”: “1.11.0”
}
}

May be not sure, I think the reason behind 504 error is the request that library was making is not register in requests.json file?

Please suggest?

Hi @akash.pagare,

The Server Method Invocation (SMI) has a 20-second timeout regardless of how the API is made. It will not wait more than 20 seconds. Does the timeout happen after 20 seconds from the invocation or before?

Does your question also mean why does it succeed locally and take more time in production?

The local system uses your computer’s CPU to run the app, and it will be faster to import the NPM library and execute the function. The production uses Freshworks’ cloud infrastructure to execute the function. It includes the time to import the NPM for every request. It may take more time.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.