<commit_before>(function () {
  angular.module('mnAdmin').controller('mnAdminController', mnAdminController);

  function mnAdminController($scope, $rootScope, $q, mnSettingsNotificationsService, mnPromiseHelper, pools, mnPoll, mnAuthService, mnTasksDetails, mnAlertsService, mnPoolDefault, mnSettingsAutoFailoverService) {
    var vm = this;
    vm.launchpadId = pools.launchID;
    vm.alerts = mnAlertsService.alerts;
    vm.closeAlert = mnAlertsService.closeAlert;
    vm.logout = mnAuthService.logout;
    vm.resetAutoFailOverCount = resetAutoFailOverCount;
    vm.isProgressBarClosed = true;
    vm.areThereMoreThenTwoRunningTasks = areThereMoreThenTwoRunningTasks;
    vm.toggleProgressBar = toggleProgressBar;

    activate();

    function areThereMoreThenTwoRunningTasks() {
      return vm.tasks && vm.tasks.running.length > 1;
    }

    function toggleProgressBar() {
      vm.isProgressBarClosed = !vm.isProgressBarClosed;
    }

    function resetAutoFailOverCount() {
      mnPromiseHelper(vm, mnSettingsAutoFailoverService.resetAutoFailOverCount())
        .showSpinner('resetQuotaLoading')
        .catchGlobalErrors('Unable to reset the auto-failover quota!')
        .reloadState()
        .cancelOnScopeDestroy($scope);
    }

    function activate() {
      mnPromiseHelper(vm, mnSettingsNotificationsService.maybeCheckUpdates())
        .applyToScope("updates")
        .onSuccess(function (updates) {
          if (updates.sendStats) {
            mnPromiseHelper(vm, mnSettingsNotificationsService.buildPhoneHomeThingy())
              .applyToScope("launchpadSource")
              .independentOfScope();
          }
        })
        .independentOfScope();

      mnPoll
        .start($scope, function () {
          return $q.all([
            mnTasksDetails.get(),
            mnPoolDefault.getFresh()
          ]);
        })
        .subscribe(function (resp) {
          vm.tasks = resp[0];
          $rootScope.tabName = resp[1] && resp[1].clusterName;
          vm.mnPoolDefault = resp[1];
        })
        .cancelOnScopeDestroy()
        .run();
    }

  }
})();
<commit_msg>MB-12222: keep previous result of mnPoll in mnAdminController<commit_after>(function () {
  angular.module('mnAdmin').controller('mnAdminController', mnAdminController);

  function mnAdminController($scope, $rootScope, $q, mnSettingsNotificationsService, mnPromiseHelper, pools, mnPoll, mnAuthService, mnTasksDetails, mnAlertsService, mnPoolDefault, mnSettingsAutoFailoverService) {
    var vm = this;
    vm.launchpadId = pools.launchID;
    vm.alerts = mnAlertsService.alerts;
    vm.closeAlert = mnAlertsService.closeAlert;
    vm.logout = mnAuthService.logout;
    vm.resetAutoFailOverCount = resetAutoFailOverCount;
    vm.isProgressBarClosed = true;
    vm.areThereMoreThenTwoRunningTasks = areThereMoreThenTwoRunningTasks;
    vm.toggleProgressBar = toggleProgressBar;

    activate();

    function areThereMoreThenTwoRunningTasks() {
      return vm.tasks && vm.tasks.running.length > 1;
    }

    function toggleProgressBar() {
      vm.isProgressBarClosed = !vm.isProgressBarClosed;
    }

    function resetAutoFailOverCount() {
      mnPromiseHelper(vm, mnSettingsAutoFailoverService.resetAutoFailOverCount())
        .showSpinner('resetQuotaLoading')
        .catchGlobalErrors('Unable to reset the auto-failover quota!')
        .reloadState()
        .cancelOnScopeDestroy($scope);
    }

    function activate() {
      mnPromiseHelper(vm, mnSettingsNotificationsService.maybeCheckUpdates())
        .applyToScope("updates")
        .onSuccess(function (updates) {
          if (updates.sendStats) {
            mnPromiseHelper(vm, mnSettingsNotificationsService.buildPhoneHomeThingy())
              .applyToScope("launchpadSource")
              .independentOfScope();
          }
        })
        .independentOfScope();

      mnPoll
        .start($scope, function () {
          return $q.all([
            mnTasksDetails.get(),
            mnPoolDefault.getFresh()
          ]);
        })
        .subscribe(function (resp) {
          vm.tasks = resp[0];
          $rootScope.tabName = resp[1] && resp[1].clusterName;
          vm.mnPoolDefault = resp[1];
        })
        .keepIn("mnAdminState", vm)
        .cancelOnScopeDestroy()
        .run();
    }

  }
})();

{'fraction_non_alphanumeric': 0.108584686774942, 'fraction_numerical': 0.0034802784222737818, 'mean_word_length': 2.9405850091407677, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1083375', 'n_tokens_mistral': 1297, 'n_tokens_neox': 1235, 'n_words': 191}