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

Increase efficiency of check for training certificates on Bulk Upload page #6410

Merged
merged 2 commits into from
Nov 15, 2024

Conversation

duncanc19
Copy link
Collaborator

Issue

With the introduction of training certificates, a check was added to the bulk upload page for training certificates for the workplace or any subs, in order to display a warning that the certificates will be deleted if they upload the training file. The functionality worked as expected, but for one particularly large parent workplace, the page was failing to load and the server continually returned a 503 response. This PR attempts to improve the efficiency of the endpoint.

Work done

  • Increased efficiency of hasTrainingCertificates endpoint by using raw sql and SELECT 1 instead of returning all data and looping through

Tests

Does this PR include tests for the changes introduced?

  • Yes
  • No, I found it difficult to test
  • No, they are not required for this change

@duncanc19 duncanc19 force-pushed the fix/make-bu-check-for-training-certs-more-efficient branch from 6328857 to d6a5383 Compare November 14, 2024 12:03
@duncanc19 duncanc19 marked this pull request as ready for review November 15, 2024 10:24
@duncanc19 duncanc19 merged commit 2ccc66f into main Nov 15, 2024
5 checks passed
@duncanc19 duncanc19 deleted the fix/make-bu-check-for-training-certs-more-efficient branch November 15, 2024 10:24
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