engines/bastion_katello/app/assets/javascripts/bastion_katello/tasks/task.factory.js in katello-3.2.1.1 vs engines/bastion_katello/app/assets/javascripts/bastion_katello/tasks/task.factory.js in katello-3.3.0.rc1

- old
+ new

@@ -20,11 +20,11 @@ angular.module('Bastion.tasks').factory('Task', ['BastionResource', '$timeout', '$log', '$q', 'CurrentOrganization', function (BastionResource, $timeout, $log, $q, CurrentOrganization) { var bulkSearchRunning = false, searchIdGenerator = 0, - searchParamsById = {}, callbackById = {}; + searchParamsById = {}, callbackById = {}, pollCount = 0, maxPollInterval = 10000; var resource = BastionResource('/katello/api/v2/tasks/:id/:action', {id: '@id', 'organization_id': CurrentOrganization}, {}); var foremanTasksResource = BastionResource('/foreman_tasks/api/tasks/:id/:action', @@ -99,12 +99,19 @@ }); } /*eslint no-use-before-define:0*/ function schedulePoll() { + var pollTime; + pollCount = pollCount + 1; + pollTime = 1000 * pollCount; + if (pollTime > maxPollInterval) { + pollTime = maxPollInterval; + } + $timeout(function () { updateProgress(true); - }, 1500); + }, pollTime); } function ensureBulkSearchRunning() { if (!bulkSearchRunning) { bulkSearchRunning = true;