-
Notifications
You must be signed in to change notification settings - Fork 29
Slow cyberstorm api endpoints (TS-2516) #1151
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
Open
Roffenlund
wants to merge
6
commits into
master
Choose a base branch
from
slow-cyberstorm-api-endpoints
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #1151 +/- ##
==========================================
+ Coverage 93.04% 93.07% +0.03%
==========================================
Files 324 326 +2
Lines 9701 9743 +42
Branches 863 868 +5
==========================================
+ Hits 9026 9068 +42
Misses 554 554
Partials 121 121 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Add a new queue intended for running tasks that are related to rendering markdown to html. Add a redis cache for caching the html once it is rendered so we do not need to re-run the rendering task but can fetch it from redis. Refs. TS-2516
Implement a celery task for rendering the markdown to html. Refs. TS-2516
Implement a service which implements the caching logic around calling the celery task with the correct variables. The intention of the service is to be re-usable with views and make unit testing easier. Refs. TS-2516
USe the markdown service which is responsible for calling the markdown task and handling the cache so we do not need to run the markdown logic in each request, but can fetch the results from cache instead. Refs. TS-2516
4d3f442 to
8fd0510
Compare
Rewrite the polling logic in the service to use the get() function from celery instead to wait for the result of a task. Raise errors when expected, the .get() function raises either a TimeoutError or Exception. No need to pass the statys_key to the celery task anymore due to the changes made in the service. Update tests accordingly. Refs. TS-2516
966e91d to
8c4ed4e
Compare
8c4ed4e to
6f6c4a9
Compare
Remove the check which raises and error if package_version.readme is None since readme cannot be null in the database. Refs. TS-2516
6f6c4a9 to
db27a96
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Implement a celery task and caching mechanism for rendering markdown to HTML. This removes the CPU overhead caused by rendering the HTML on every request.