diff --git a/src/store/modules/Operations/ControlStore.js b/src/store/modules/Operations/ControlStore.js index 9b8bf73dcc..022a49d37d 100644 --- a/src/store/modules/Operations/ControlStore.js +++ b/src/store/modules/Operations/ControlStore.js @@ -4,24 +4,27 @@ import i18n from '@/i18n'; /** * Watch for serverStatus changes in GlobalStore module * to set isOperationInProgress state - * Stop watching status changes and resolve Promise when - * serverStatus value matches passed argument or after 5 minutes + * Allows run get API from redfish function starting + * after the interval of 5 seconds time, then repeating continuously + * at that interval until serverStatus value matches passed argument + * then Stop watching status changes and resolve Promise. * @param {string} serverStatus * @returns {Promise} */ const checkForServerStatus = function (serverStatus) { return new Promise((resolve) => { - const timer = setTimeout(() => { + const timer = setInterval(() => { + this.dispatch('global/getSystemInfo'); resolve(); unwatch(); - }, 300000 /*5mins*/); + }, 5000); /*5seconds*/ const unwatch = this.watch( (state) => state.global.serverStatus, (value) => { if (value === serverStatus) { resolve(); unwatch(); - clearTimeout(timer); + clearInterval(timer); } } ); diff --git a/src/views/Operations/ServerPowerOperations/ServerPowerOperations.vue b/src/views/Operations/ServerPowerOperations/ServerPowerOperations.vue index ba9ebcedcb..80046f3c5f 100644 --- a/src/views/Operations/ServerPowerOperations/ServerPowerOperations.vue +++ b/src/views/Operations/ServerPowerOperations/ServerPowerOperations.vue @@ -205,6 +205,7 @@ export default { Promise.all([ this.$store.dispatch('serverBootSettings/getBootSettings'), this.$store.dispatch('controls/getLastPowerOperationTime'), + this.$store.dispatch('global/getSystemInfo'), bootSettingsPromise, ]).finally(() => this.endLoader()); },