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

Only refresh token if the token have expired when returning wb creds #223

Merged
merged 3 commits into from
Feb 4, 2025

Conversation

adlius
Copy link
Collaborator

@adlius adlius commented Feb 4, 2025

We suspect that constant calls to external services to refresh tokens is behind the reason why performance is slow on staging and test. So we should only refresh tokens when we need to.

@adlius adlius requested a review from opaduchak February 4, 2025 05:10
and addon.base_account.oauth2_token_metadata.access_token_expiration
and addon.base_account.oauth2_token_metadata.access_token_expiration
< timezone.now()
):
addon.base_account.refresh_oauth_access_token__blocking()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: maybe we can alter logic of refresh_oauth_access_token method for it to refresh token only if it is expired (we may also add a parameter force: bool, which would allow to bypass this limitation if needed)

Copy link
Collaborator

@opaduchak opaduchak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@adlius adlius changed the base branch from release/25.1.0 to develop February 4, 2025 14:55
@adlius adlius merged commit 8804e2a into develop Feb 4, 2025
2 checks passed
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.

2 participants