-
Notifications
You must be signed in to change notification settings - Fork 15
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
Longévité des snippets #5
Comments
Macos users: [Installing redis] ~ with brew (https://brew.sh): open your terminal and write => brew install redis ~ without brew: you need also open your terminal and write => wget https://download.redis.io/releases/redis-6.0.9.tar.gz => tar xzf redis-6.0.9.tar.gz => cd redis-6.0.9 => make [Starting redis] ~ with brew: write => brew services start redis if server successfully you will receive: ==> Successfully started `redis` (label: homebrew.mxcl.redis) ~ without brew: write => src/redis-server [Verifying if redis is running] ~ only with brew: write => redis-cli ping <= if the reply is "PONG" then you are good to go [Stopping redis] ~ with brew: write => brew services stop redis ~ without brew: juste CTRL+C the execution
Macos users: [Installing redis] ~ with brew (https://brew.sh): open your terminal and write => brew install redis ~ without brew: you need also open your terminal and write => wget https://download.redis.io/releases/redis-6.0.9.tar.gz => tar xzf redis-6.0.9.tar.gz => cd redis-6.0.9 => make [Starting redis] ~ with brew: write => brew services start redis if server successfully you will receive: ==> Successfully started `redis` (label: homebrew.mxcl.redis) ~ without brew: write => src/redis-server [Verifying if redis is running] ~ only with brew: write => redis-cli ping <= if the reply is "PONG" then you are good to go [Stopping redis] ~ with brew: write => brew services stop redis ~ without brew: juste CTRL+C the execution
On met sur combien la taille maximale de la db ? |
200 Mo ? Ce sera large. |
Ok de toute façon ça c'est sur la bdd directement qu'il foudra le configurer. |
On peut fournir un fichier de configuration d'exemple avec les instructions sur comment l'utiliser. On peut faire une page dans le wiki pour ça :) |
Yep ça me serait utile merci 👌 |
The user is now able to set a maximum number of views/uses on his snippets. By default, this number is infinite. The user can turn off the infinite views by unchecking the 'infinite_views checkbox and by entering a views number in the 'max_views' input field (it has to be a number greater than 0). Every time the snippet's page is visited, its views left decrease, and when it gets to 0, the snippet is deleted from the database. Related to #5
The server now takes into account request's multipart file and form posts with new default values for parameters, and errors handling with `contextlib.suppress()` has been implemented instead of basics try-except statements. Todo statements has been removed as well as the code that they were related to, like the form for snippets maxusage for which a new issue will be created. The in-memory database has been replaced by an error raising because it was not convenient at all. It will be re-implemented in a better way later for unit-testing. Related to #5
The user is now able to set a maximum number of views/uses on his snippets. By default, this number is infinite. The user can turn off the infinite views by unchecking the 'infinite_views checkbox and by entering a views number in the 'max_views' input field (it has to be a number greater than 0). Every time the snippet's page is visited, its views left decrease, and when it gets to 0, the snippet is deleted from the database. Related to #5
The server now takes into account request's multipart file and form posts with new default values for parameters, and errors handling with `contextlib.suppress()` has been implemented instead of basics try-except statements. Todo statements has been removed as well as the code that they were related to, like the form for snippets maxusage for which a new issue will be created. The in-memory database has been replaced by an error raising because it was not convenient at all. It will be re-implemented in a better way later for unit-testing. Related to #5
The user is now able to set a maximum number of views/uses on his snippets. By default, this number is infinite. The user can turn off the infinite views by unchecking the 'infinite_views checkbox and by entering a views number in the 'max_views' input field (it has to be a number greater than 0). Every time the snippet's page is visited, its views left decrease, and when it gets to 0, the snippet is deleted from the database. Related to #5
The server now takes into account request's multipart file and form posts with new default values for parameters, and errors handling with `contextlib.suppress()` has been implemented instead of basics try-except statements. Todo statements has been removed as well as the code that they were related to, like the form for snippets maxusage for which a new issue will be created. The in-memory database has been replaced by an error raising because it was not convenient at all. It will be re-implemented in a better way later for unit-testing. Related to #5
Using the Redis EXPIRE command to limit the lifetime of a snippet in the database. This time is defined by the DEFAULT_LIFETIME_HOURS config variable or the form's `lifetime` value or -1 if none of them is provided which means no time limit (the lifetime should be greater than 0 for the EXPIRE command to be applied). Related to #5
Using the Redis EXPIRE command to limit the lifetime of a snippet in the database. This time is defined by the DEFAULT_LIFETIME_HOURS config variable or the form's `lifetime` value or -1 if none of them is provided which means no time limit (the lifetime should be greater than 0 for the EXPIRE command to be applied). Related to #5
Using the Redis EXPIRE command to limit the lifetime of a snippet in the database. This time is defined by the DEFAULT_LIFETIME_HOURS config variable or the form's `lifetime` value or -1 if none of them is provided which means no time limit (the lifetime should be greater than 0 for the EXPIRE command to be applied). Related to #5
Ne pas oublier qu'il faut ajouter un menu dans le frontend pour rendre tout ceci facilement configurable !! |
CC #34 |
J'voulais le faire mais j'ai abandonné j'suis trop nul en front |
Ne devrait-on pas fermer cette issue ? |
Il manque l'UI |
En effet, je suis passé à côté |
Fixé par #53 |
Au lieu de limiter les snippets dans le temps, nous avons décider de limiter la taille de la base de donnée Redis. Ainsi, lorsque l'usage mémoire sera trop conséquent (valeur à déterminer), les snippets peu lus et plus anciens seront supprimés pour laisser place aux nouveaux. Cela sera réalisable grâce au mécanisme LRU de Redis.
Les snippets pourront tout de même avoir une limite de temps choisie par l'utilisateur, qui sera définie par défaut sur 1 semaine, et aussi une limite d'utilisations qui sera par défaut infinie.
À faire :
The text was updated successfully, but these errors were encountered: