Commit a48bb27898939175e6a4f81554dc9c8218248ff4

Authored by Sergio Oliveira
1 parent 1b21cac6

Using redis connection from celery to create locks

Signed-off-by: Alexandre Barbosa <alexandreab@live.com>
Signed-off-by: Athos Ribeiro <athoscribeiro@gmail.com>
Signed-off-by: Sergio Oliveira <sergio@tracy.com.br>
Showing 1 changed file with 1 additions and 1 deletions   Show diff stats
colab/plugins/data/tasks.py
@@ -16,7 +16,7 @@ TASKS = set() @@ -16,7 +16,7 @@ TASKS = set()
16 def lock(method, name): 16 def lock(method, name):
17 def wrapped_method(self, *args, **kwargs): 17 def wrapped_method(self, *args, **kwargs):
18 lock_id = 'colab-data-importer-{}'.format(name) 18 lock_id = 'colab-data-importer-{}'.format(name)
19 - lock = redis.Redis().lock(lock_id) 19 + lock = app.backend.client.lock(lock_id)
20 20
21 if lock.acquire(blocking=False): 21 if lock.acquire(blocking=False):
22 try: 22 try: