From c227db214fa88865ebe4e3adc84c169cecf96031 Mon Sep 17 00:00:00 2001
From: Erik Reid <erik.reid@geant.org>
Date: Thu, 4 Jun 2020 22:20:18 +0200
Subject: [PATCH] decouple check status and update timers

---
 inventory_provider/static/update.js | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/inventory_provider/static/update.js b/inventory_provider/static/update.js
index d3b92d6e..11d7004c 100644
--- a/inventory_provider/static/update.js
+++ b/inventory_provider/static/update.js
@@ -30,9 +30,6 @@ myApp.controller('update', function($scope, $http, $timeout) {
                     $scope.update_request_status = "";
                 }
                 $timeout($scope.check_status, 5000);
-                if ($scope.latch_pending || $scope.latch_error) {
-                    $scope.refresh_update_status();
-                }
             },
             /* error response */
             function(rsp) {
@@ -58,6 +55,7 @@ myApp.controller('update', function($scope, $http, $timeout) {
                 $scope.failed = rsp.data.failed;
                 $scope.warnings = rsp.data.warnings;
                 $scope.errors = rsp.data.errors;
+                $timeout($scope.refresh_update_status, 2000);
             },
             /* error response */
             function(rsp) {
@@ -66,6 +64,7 @@ myApp.controller('update', function($scope, $http, $timeout) {
                 $scope.failed = [];
                 $scope.errors = [];
                 $scope.warnings = [];
+                $timeout($scope.refresh_update_status, 5000);
             }
         );
 
@@ -95,4 +94,6 @@ myApp.controller('update', function($scope, $http, $timeout) {
     }
 
     $scope.check_status();
+    $scope.refresh_update_status();
+
 });
\ No newline at end of file
-- 
GitLab