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

Do not retrieve the auth-token on every call #2

Merged
merged 13 commits into from
Aug 10, 2023

Conversation

alejanderl
Copy link

@alejanderl alejanderl commented Aug 9, 2023

DEV-717

This PR fixes retrieving one auth token on every request, so using the TTL of the token to reuse the valid one.
This will reduce by half the response time for medical conditions search
image

@alejanderl alejanderl force-pushed the alj/avoid_get_token_on_every_request branch from 0f96d69 to 33d9b50 Compare August 9, 2023 21:34
@alejanderl alejanderl changed the title Do not retrieve a token on every call Do not retrieve the auth-token on every call Aug 10, 2023
@alejanderl alejanderl force-pushed the alj/avoid_get_token_on_every_request branch from 1d8a411 to 50254d9 Compare August 10, 2023 06:56
describe '#retrieve_access_token' do
subject { described_class.call }

it 'sends request to token endpoint' do

Choose a reason for hiding this comment

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

maybe add request matchers?

Copy link
Author

Choose a reason for hiding this comment

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

But they are in the cassette:
spec/vcr/icd/api/authorize_token.yml
So the vcr_cassette contains the right URL and also the response payload.

@alejanderl alejanderl merged commit b0096af into main Aug 10, 2023
@alejanderl alejanderl deleted the alj/avoid_get_token_on_every_request branch August 10, 2023 14:52
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