From 623d4d76ad068fdbd9050767151697dc277e3298 Mon Sep 17 00:00:00 2001 From: Michael Date: Tue, 2 Aug 2022 10:29:44 -0400 Subject: [PATCH] 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 --- src/components/LinkItems/Item.vue | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/components/LinkItems/Item.vue b/src/components/LinkItems/Item.vue index 24df237e..581d4a7a 100644 --- a/src/components/LinkItems/Item.vue +++ b/src/components/LinkItems/Item.vue @@ -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() {