🔀 Merge pull request #828 from miclav/bug/periodic-check

Only do periodic check when statuscheck is enabled
This commit is contained in:
Alicia Sykes 2022-08-02 16:53:53 +01:00 committed by GitHub
commit 07a81eb075
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -172,11 +172,13 @@ export default {
}, },
mounted() { mounted() {
// If ststus checking is enabled, then check service status // If ststus checking is enabled, then check service status
if (this.enableStatusCheck) this.checkWebsiteStatus(); if (this.enableStatusCheck) {
this.checkWebsiteStatus();
// If continious status checking is enabled, then start ever-lasting loop // If continious status checking is enabled, then start ever-lasting loop
if (this.statusCheckInterval > 0) { if (this.statusCheckInterval > 0) {
this.intervalId = setInterval(this.checkWebsiteStatus, this.statusCheckInterval * 1000); this.intervalId = setInterval(this.checkWebsiteStatus, this.statusCheckInterval * 1000);
} }
}
}, },
beforeDestroy() { beforeDestroy() {
// Stop periodic status-check when item is destroyed (e.g. navigating in multi-page setup) // Stop periodic status-check when item is destroyed (e.g. navigating in multi-page setup)