-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Handling API limit #344
Comments
The library provides the export const retry = async (n: number, func: Function, timoutinMilliseconds: number = 300, logFunction?: Function) which can be used to repeat the calls. Now that mindsphere provided I don't want to have implicit error handling for whole framework, because the API behavior has sometimes subtle differences from API to API - but a better retry method would be worth looking at. |
Example for using the retry function: const assetMgmt = sdk.GetAssetManagementClient();
const asset = (await retry(options.retry, () =>
assetMgmt.GetAsset(options.assetid)
)) as AssetManagementModels.AssetResourceWithHierarchyPath; |
Sounds promising, but you should consider some special SDK functions, e.g.:
In case of MindConnectAgent.PutDataMapping, the number of API calls is depending on the input argument. |
I never understood why there is no bulk method for creation of data mappings. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
All Mindsphere API call (e.g. Mindconnect API) can answer with an error "API rate limit exceeded"...
This special error also gives an info about a relative time (Retry-After) which indicates that how long in 'seconds' have to wait before making a new request.
My opinion is that, the mindconnect-nodejs should handle this error, and automatically resend the requested message when the defined time is elapsed.
Probably the best place is all implementation of TokenRotation.HttpAction interface function:
mindconnect-nodejs/src/api/mindconnect-base.ts
Line 51 in d4470fb
The text was updated successfully, but these errors were encountered: