Skip to content
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

Added CancellationToken support to Historical Expenditure/Census endpoints in API #1687

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

WolfyUK
Copy link
Collaborator

@WolfyUK WolfyUK commented Dec 20, 2024

Context

AB#242727 AB#237633

Change proposed in this pull request

For the above endpoints only in the Insight function app, support the cancellation of the underlying SQL queries when the client aborts the request. This can be rolled out elsewhere when needed via consumption and propagation of the CancellationToken from Function, through Service to Query. To prevent excessive errors in the logs, the TaskCanceledException logs at Information level instead of Error via custom exception handling middleware that again could be rolled out everywhere (existing try/catches in functions will need to be removed).

NOTE: This is effective in the API only. Future work will allow requests from the Web proxy to be aborted and propagated.

Guidance to review

To validate, use Swagger UI to test the above endpoints and close/refresh the page during execution (the 'Cancel' button in Swagger UI does not abort the request). Other clients such as Postman may support aborting the request in a better fashion.

Checklist (add/remove as appropriate)

  • Work items have been linked (use AB#)
  • Your code builds clean without any errors or warnings
  • You have run all unit/integration tests and they pass
  • Your branch has been rebased onto main
  • You have tested by running locally
  • You have reviewed with UX/Design

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant