diff --git a/CHANGELOG.md b/CHANGELOG.md index 481b755a..0c6d781b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ # Karafka Web changelog +## 0.7.1 (Unreleased) +- **[Fix]** Validate refresh time. + ## 0.7.0 (2023-09-14) - **[Feature]** Introduce graphs. - **[Feature]** Introduce historical metrics storage. diff --git a/Gemfile.lock b/Gemfile.lock index dd32bc97..7c075808 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - karafka-web (0.7.0) + karafka-web (0.7.1) erubi (~> 1.4) karafka (>= 2.2.3, < 3.0.0) karafka-core (>= 2.2.2, < 3.0.0) diff --git a/lib/karafka/web/ui/public/javascripts/live_poll.js b/lib/karafka/web/ui/public/javascripts/live_poll.js index 3f283a74..efc3a510 100644 --- a/lib/karafka/web/ui/public/javascripts/live_poll.js +++ b/lib/karafka/web/ui/public/javascripts/live_poll.js @@ -116,6 +116,15 @@ function scheduleLivePoll() { } let ti = parseInt(localStorage.karafkaTimeInterval) || 5000; + + // Ensure refresh frequency is not less than 1 second + // Prevent a case where local storage could be modified in such a way, that would cause issues + // due to too frequent refreshes + if (ti < 1000) { + localStorage.karafkaTimeInterval = 5000 + ti = 5000 + } + livePollTimer = setTimeout(livePollCallback, ti); } diff --git a/lib/karafka/web/version.rb b/lib/karafka/web/version.rb index b20740b3..e6df9b17 100644 --- a/lib/karafka/web/version.rb +++ b/lib/karafka/web/version.rb @@ -3,6 +3,6 @@ module Karafka module Web # Current gem version - VERSION = '0.7.0' + VERSION = '0.7.1' end end