Only do periodic check when statuscheck is enabled

Before all items were requesting status checks
even if status check wasn't enabled for them
creating lots of request to the backend for no reason
This commit is contained in:
Michael 2022-08-02 10:29:44 -04:00
parent 89cf918b9f
commit 623d4d76ad
1 changed files with 6 additions and 4 deletions

View File

@ -172,10 +172,12 @@ export default {
},
mounted() {
// If ststus checking is enabled, then check service status
if (this.enableStatusCheck) this.checkWebsiteStatus();
// If continious status checking is enabled, then start ever-lasting loop
if (this.statusCheckInterval > 0) {
this.intervalId = setInterval(this.checkWebsiteStatus, this.statusCheckInterval * 1000);
if (this.enableStatusCheck) {
this.checkWebsiteStatus();
// If continious status checking is enabled, then start ever-lasting loop
if (this.statusCheckInterval > 0) {
this.intervalId = setInterval(this.checkWebsiteStatus, this.statusCheckInterval * 1000);
}
}
},
beforeDestroy() {