Scifabric / pybossa

PYBOSSA is the ultimate crowdsourcing framework (aka microtasking) to analyze or enrich data that can't be processed by machines alone.
http://pybossa.com
GNU Affero General Public License v3.0
745 stars 269 forks source link

fix(redis): cache was bad handled. #1943

Closed teleyinex closed 5 years ago

teleyinex commented 5 years ago

Revert back changes introduced by @kod-kristoff .

The changes caused several problems. For example, all background jobs were disabled, and those jobs are required to run a PYBOSSA server.

Also, the cache is different from why PYBOSSA uses Redis/Sentinel. Redis is used for caching some queries, but also, for handling information via the API (like stats).

For this reason, these commits revert back all the changes and restore the default behavior.

kod-kristoff commented 5 years ago

Ok, my bad, I thought that it was possible to run pybossa without Redis, can now see that it is only caching that can be disabled.

Though in util.py I insist that the old way of testing if the cache should be disabled conflicts with the documentation. From the documentation: export PYBOSSA_REDIS_CACHE_DISABLED='1' should be converted to this in Python: os.environ.get('PYBOSSA_REDIS_CACHE_DISABLED') != "'1'" # environment variables are always strings or with previous version (export PYBOSSA_REDIS_CACHE_DISABLED=1): os.environ.get('PYBOSSA_REDIS_CACHE_DISABLED') != '1' # environment variables are always strings

os.environ.get('PYBOSSA_REDIS_CACHE_DISABLED') is None disables the cache for all values of the environment value, especially export PYBOSSA_REDIS_CACHE_DISABLED=0.