Reputation: 1557
We work with Autodesk FORGE REST API with forge-apis library. Since today we have an unstable behaviour when calling its methods. Here is the error:
address: “34.203.81.163” code: “ETIMEDOUT” errno: “ETIMEDOUT” port: 443 syscall: “connect” message: “connect ETIMEDOUT 34.203.81.163:443” stack: “Error: connect ETIMEDOUT 34.203.81.163:443↵ at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1162:14)”
Is there something we need to change in our code or we're getting to some threshold in a number of API calls or this is a temporary internal instability?
Upvotes: 0
Views: 282
Reputation: 7070
There is a default HTTP timeout, 60000 milliseconds, in the src/ApiClient.js. When you received this message, it means that you didn't get the response from Forge server after 60000 milliseconds. Please try to increase the timeout value of the ApiClient
. Here are two ways to make this change:
Method 1:
var bucketsApi = new ForgeSDK.BucketsApi();
bucketsApi.apiClient.timeout = 2 * 60000;
var objectsApi = new ForgeSDK.ObjectsApi();
objectsApi.apiClient.timeout = 2 * 60000;
Method 2:
var apiClient = new ForgeSDK.ApiClient();
apiClient.timeout = 2 * 60000;
var bucketsApi = new ForgeSDK.BucketsApi( apiClient );
var objectsApi = new ForgeSDK.ObjectsApi( apiClient );
Hope it helps!
Cheers,
Upvotes: 1