Remove auth caching from chat backend #4076
Closed
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.
Purpose
This pull request removes the auth caching mechanism from the chat backend to improve consistency and simplify the codebase.
Description
The chat backend currently uses auth caching to improve performance. This is implemented using the
diskcache
library with aCache
object namedauth_cache
. The caching is applied to two main functions:get_cached_installation_id
andget_github_client_from_org
.To remove the auth caching, the following changes have been made:
auth_cache
object.@auth_cache.memoize()
decorators from the relevant functions.get_cached_installation_id
->get_installation_id_for_org
,get_github_client_from_org
->get_github_client_from_org
).Summary
auth_cache
object@auth_cache.memoize()
decorators fromget_cached_installation_id
andget_github_client_from_org
functionsget_cached_installation_id
toget_installation_id_for_org
andget_github_client_from_org
toget_github_client_from_org
Suggested changes from Sweep Chat by @kevinlu1248. Continue chatting at http://localhost:3000/c/e2e3b4b9-3ec2-4081-8997-f565a5508064.