Set clean_timeout = 0 by default?

Rational

Currently the default value for cache/clean_timeout is = 300. This means that the cache of translatable fields (as well as the other caches) will take 5 minutes to take effect in the workers others than the one used by the user when the value was changed (when uwsgi or another Web Server Interface is used).

This is specially annoying when the web server interface does a real round robin and does not stick requests per IP address of the user as the user will save the translated value but when reloaded, it will see the previous value.

Proposal

Given that LISTEN/NOTIFY is available in all PostgreSQL versions and that PostgreSQL is the only recommended database for production environments I think it makes sense to set clean_timeout = 0 which will make Tryton to use this the channel to update caches of all workers.

Another possibility would be tu accept a negative value (-1) that would be the default and that it would make it use the channel on PostgreSQL but would use a default timeout of 300 seconds when database backend without channel support is used.

Thoughts?

The problem described is already solved by Issue 9013: Wrong cache used for translations - Tryton issue tracker
Using the channel for cache should stay an opt-in option because it is much complex behavior and can overload the database with connections.

Understood. I remember that when I tried that patch didn’t work for me.

Will try it again and investigate if it does not work.