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

fix: Update middleware.py to remove excess calls to Organization objects #5514

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

tsr10
Copy link

@tsr10 tsr10 commented Feb 27, 2024

…irst()

Organization.first() was being called too many times. This tries to find it on the user object. See attached screenshot for an example of the extra load this was causing.

image

PR fulfills these requirements

  • Commit message(s) and PR title follows the format [fix|feat|ci|chore|doc]: TICKET-ID: Short description of change made ex. fix: DEV-XXXX: Removed inconsistent code usage causing intermittent errors
  • Tests for the changes have been added/updated (for bug fixes/features)
  • Docs have been added/updated (for bug fixes/features)
  • Best efforts were made to ensure docs/code are concise and coherent (checked for spelling/grammatical errors, commented out code, debug logs etc.)
  • Self-reviewed and ran all changes on a local instance (for bug fixes/features)

Change has impacts in these area(s)

(check all that apply)

  • Product design
  • Backend (Database)
  • Backend (API)
  • Frontend

Describe the reason for change

(link to issue, supportive screenshots etc.)

What does this fix?

(if this is a bug fix)

What is the new behavior?

(if this is a breaking or feature change)

What is the current behavior?

(if this is a breaking or feature change)

What libraries were added/updated?

(list all with version changes)

Does this change affect performance?

(if so describe the impacts positive or negative)

Does this change affect security?

(if so describe the impacts positive or negative)

What alternative approaches were there?

(briefly list any if applicable)

What feature flags were used to cover this change?

(briefly list any if applicable)

Does this PR introduce a breaking change?

(check only one)

  • Yes, and covered entirely by feature flag(s)
  • Yes, and covered partially by feature flag(s)
  • No
  • Not sure (briefly explain the situation below)

What level of testing was included in the change?

(check all that apply)

  • e2e
  • integration
  • unit

Which logical domain(s) does this change affect?

(for bug fixes/features, be as precise as possible. ex. Authentication, Annotation History, Review Stream etc.)

…irst()

Organization.first() was being called too many times. This tries to find it on the user object.
Copy link

netlify bot commented Feb 27, 2024

👷 Deploy request for label-studio-docs-new-theme pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit cae6b13

Copy link

netlify bot commented Feb 27, 2024

👷 Deploy request for heartex-docs pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit cae6b13

@tsr10 tsr10 changed the title Update middleware.py to remove excess calls to Organization.objects.f… [fix] Update middleware.py to remove excess calls to Organization.objects.f… Feb 27, 2024
@makseq makseq changed the title [fix] Update middleware.py to remove excess calls to Organization.objects.f… fix: Update middleware.py to remove excess calls to Organization objects Feb 27, 2024
Copy link

codecov bot commented Mar 10, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 75.89%. Comparing base (9a03cb5) to head (cae6b13).
Report is 236 commits behind head on develop.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #5514    /-   ##
========================================
  Coverage    75.89%   75.89%           
========================================
  Files          156      156           
  Lines        13020    13023     3     
========================================
  Hits          9881     9884     3     
  Misses        3139     3139           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@sajarin
Copy link
Contributor

sajarin commented Jun 5, 2024

/jira create

Workflow run
Jira issue TRIAG-598 is created

@sajarin sajarin added performance Performance & high load-related issues Community Community Feature Requests, Open Issues, Bugs Reported, or Comments community:fix labels Jun 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
community:fix Community Community Feature Requests, Open Issues, Bugs Reported, or Comments fix performance Performance & high load-related issues
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants