From a48bb27898939175e6a4f81554dc9c8218248ff4 Mon Sep 17 00:00:00 2001 From: Sergio Oliveira Date: Thu, 1 Oct 2015 16:08:41 -0300 Subject: [PATCH] Using redis connection from celery to create locks --- colab/plugins/data/tasks.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/colab/plugins/data/tasks.py b/colab/plugins/data/tasks.py index 79b8d72..3707312 100644 --- a/colab/plugins/data/tasks.py +++ b/colab/plugins/data/tasks.py @@ -16,7 +16,7 @@ TASKS = set() def lock(method, name): def wrapped_method(self, *args, **kwargs): lock_id = 'colab-data-importer-{}'.format(name) - lock = redis.Redis().lock(lock_id) + lock = app.backend.client.lock(lock_id) if lock.acquire(blocking=False): try: -- libgit2 0.21.2