From c99e42126d81430a37ff56cd3861af5b3e1031c3 Mon Sep 17 00:00:00 2001
From: Robert Latta <robert.latta@geant.org>
Date: Thu, 20 Jun 2019 12:04:10 +0000
Subject: [PATCH] changed to use asynch commands instead of group to avoid
 crashing dev environment

---
 inventory_provider/tasks/worker.py | 21 +++++++++++----------
 1 file changed, 11 insertions(+), 10 deletions(-)

diff --git a/inventory_provider/tasks/worker.py b/inventory_provider/tasks/worker.py
index d1800813..13d394e5 100644
--- a/inventory_provider/tasks/worker.py
+++ b/inventory_provider/tasks/worker.py
@@ -458,27 +458,28 @@ def launch_refresh_cache_all(config):
 
     # first batch of subtasks: refresh cached opsdb data
     subtasks = [
-        update_junosspace_device_list.s(),
-        update_interfaces_to_services.s(),
-        update_geant_lambdas.s(),
-        update_circuit_hierarchy.s()
+        update_junosspace_device_list.apply_async(),
+        update_interfaces_to_services.apply_async(),
+        update_geant_lambdas.apply_async(),
+        update_circuit_hierarchy.apply_async()
     ]
-
-    results = group(subtasks).apply_async()
-    results.join()
+    [x.get() for x in subtasks]
 
     # second batch of subtasks:
     #   alarms db status cache
     #   juniper netconf & snmp data
     subtasks = [
-        update_equipment_locations.s(),
+        update_equipment_locations.apply_async(),
     ]
     for hostname in _derive_router_hostnames(config):
         logger.debug(
             'queueing router refresh jobs for %r' % hostname)
-        subtasks.append(reload_router_config.s(hostname))
+        subtasks.append(reload_router_config.apply_async(args=[hostname]))
+        break
 
-    return [r.id for r in group(subtasks).apply_async()]
+    [x.get() for x in subtasks]
+    
+    return [x.id for x in subtasks]
 
 
 def check_task_status(task_id):
-- 
GitLab