Allowing for async checks in fastApi. Cleaning up old code. #114
Merged
alexcottner merged 3 commits intomainfrom Apr 24, 2024
Merged
Allowing for async checks in fastApi. Cleaning up old code. #114alexcottner merged 3 commits intomainfrom
alexcottner merged 3 commits intomainfrom
Conversation
grahamalama
previously approved these changes
Apr 24, 2024
|
|
||
|
|
||
| def heartbeat(request: Request, response: Response): | ||
| async def heartbeat(request: Request, response: Response): |
Contributor
There was a problem hiding this comment.
I'm wondering if it's important to give users the choice to run these pre-baked views (and in this case, the underlying checks) synchronously or asynchronously, or if we should go all in on async at some point and make all of these FastAPI views async 🤔
Contributor
Author
There was a problem hiding this comment.
I can't think of any real harm with allowing both sync/async checks to be ran. In general, I think async always makes more sense in an API context. But if some checks are simple things like "Do I have proper context/config?", then yeah that won't really be async.
grahamalama
approved these changes
Apr 24, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #106 by running checks with
run_checks_async.Removed some old code that is no longer needed.