-
Notifications
You must be signed in to change notification settings - Fork 77
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
[DONE] Use cache to store video data #969
Conversation
… store video data
Pour les infos/doc, je suis allé voir de ce côté : https://docs.djangoproject.com/fr/3.2/topics/cache/ |
…video data instead of repeat code
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Je n'ai pas testé en local mais niveau code, c'est bon pour moi.
C'est une bonne idée d'utiliser les caches pour ça !
PS : dans la PR stats, j'ai retiré ça du context_processor
pour le mettre dans un template tag.
J'adapterais aussi en conséquence pour utiliser les caches.
Merci pour ta PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
une mini remarque mais c'est bon pour moi ;)
"""Function called to store video data in cache.""" | ||
cache.delete(['DISCIPLINES', 'VIDEOS_COUNT', 'VIDEOS_DURATION', 'TYPES']) | ||
request = None | ||
video_data = context_video_data(request) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
J'aurais mis directement "None" à la place de request vu qu'on ne le réutilise pas, mais sinon OK pour moi ;)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok , j'ai egalement fixé un petit bug qui ne supprimait pas les données puisqu'il fallait utiliser delete_many.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pour ma part, tout me semble bon au niveau du code. Je n'ai testé en local.
* Use cache to store video data - get it in context - create command to store video data * change name of video context processor * add some pydoc * update cache timeout to 600 seconds - use DRY and call context cache video data instead of repeat code * use delete many to clear cache
Before sending your pull request, make sure the following are done :
develop
branch.[WIP]
or[DONE]
.