This project is intended to give those developers consuming our API an example of some best-practice in completing work when dealing with license tokens.
When processing volumes of work in the context of something like a service worker; it is considered best practice to reuse a long-lived token, rather than to request and dispose of a license token for each request. In simple terms, this can reduce each transaction from 3 calls to 1. Depending on your flow, this can greatly reduce the load on the SQL database by preventing additional queries necessary by the create license process.
- Ensure we have a token:
- Load our stored license token (if we have one).
- If we do not have one, request a new one and save it for future use.
- Do any work that needs to be completed that requires a token.
- If we are unable to complete work because our license is expired:
- Remove invalid stored token.
- Restart the flow, if we have not failed too many times already.
This project completes three API requests:
- Get License Token
- Get Database List
- Return License Token (set inactive)
- .NET 5
- GlobalSearch 6.0+