Skip to content

Ved 0000 perf test increase rps#1386

Draft
avshetty1980 wants to merge 2 commits intomasterfrom
VED-0000-perf-test-increase-rps
Draft

Ved 0000 perf test increase rps#1386
avshetty1980 wants to merge 2 commits intomasterfrom
VED-0000-perf-test-increase-rps

Conversation

@avshetty1980
Copy link
Copy Markdown
Contributor

Summary

  • Routine Change
  • ❗ Breaking Change
  • 🤖 Operational or Infrastructure Change
  • ✨ New Feature
  • ⚠️ Potential issues that might be caused by this change

Add any other relevant notes or explanations here. Remove this line if you have nothing to add.

Reviews Required

  • Dev
  • Test
  • Tech Author
  • Product Owner

Review Checklist

ℹ️ This section is to be filled in by the reviewer.

  • I have reviewed the changes in this PR and they fill all of the acceptance criteria of the ticket.
  • If there were infrastructure, operational, or build changes, I have made sure there is sufficient evidence that the changes will work.
  • If there were changes that are outside of the regular release processes e.g. account infrastructure to setup, manual setup for external API integrations, secrets to set, then I have checked that the developer has flagged this to the Tech Lead as release steps.
  • I have checked that no Personal Identifiable Data (PID) is logged as part of the changes.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 8, 2026

This branch is working on a ticket in the NHS England VED JIRA Project. Here's a handy link to the ticket:

VED-0000

@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud bot commented Apr 8, 2026

Comment on lines +96 to +103
now = int(time.time()) # re-read after acquiring the lock
if (
self._auth.cached_access_token
and self._auth.cached_access_token_expiry_time is not None
and self._auth.cached_access_token_expiry_time > now + 30
):
return self._auth.cached_access_token
return self._auth.get_access_token()
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This check is the first thing that get_access_token() does. Given we have the lock, we can just call that instead.

Suggested change
now = int(time.time()) # re-read after acquiring the lock
if (
self._auth.cached_access_token
and self._auth.cached_access_token_expiry_time is not None
and self._auth.cached_access_token_expiry_time > now + 30
):
return self._auth.cached_access_token
return self._auth.get_access_token()
return self._auth.get_access_token()

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