Update Redis lock to support Redis version < 5.0

Update the Redis lock connection intialization so that is works with
Redis versions < 5.0.

GitLab issue #709. Rob de Canha-Knight (@rssfed23) for the report
and debug information.

Signed-off-by: Roberto Rosario <roberto.rosario@mayan-edms.com>
This commit is contained in:
Roberto Rosario
2019-12-16 04:20:17 -04:00
parent ef514d5310
commit 778c48d11d
2 changed files with 5 additions and 1 deletions

View File

@@ -7,6 +7,9 @@
Thanks to O2 Graphics (@O2Graphics). Thanks to O2 Graphics (@O2Graphics).
- Fix document orientaton detection. GitLab issue #713. Thanks to - Fix document orientaton detection. GitLab issue #713. Thanks to
Rob de Canha-Knight (@rssfed23) for the report and debug information. Rob de Canha-Knight (@rssfed23) for the report and debug information.
- Update the Redis lock connection intialization so that is works with Redis
versions < 5.0. GitLab issue #709. Rob de Canha-Knight (@rssfed23) for the
report and debug information.
3.3.5 (2019-12-13) 3.3.5 (2019-12-13)
================== ==================

View File

@@ -18,7 +18,8 @@ class RedisLock(LockingBackend):
def get_redis_connection(cls): def get_redis_connection(cls):
redis_url = setting_backend_arguments.value.get('redis_url', None) redis_url = setting_backend_arguments.value.get('redis_url', None)
server = redis.from_url(url=redis_url) server = redis.from_url(url=redis_url)
server.client_id() # Force to initialize the connection
server.client()
return server return server
@classmethod @classmethod