diff options
author | Alfredo Sumaran <alfredo@gitlab.com> | 2016-03-02 18:23:36 -0500 |
---|---|---|
committer | Alfredo Sumaran <alfredo@gitlab.com> | 2016-03-03 15:20:01 -0500 |
commit | 948ebfeb013685b482a6afed5eab1355bd8f3171 (patch) | |
tree | dcaf1b8d2ba40ad1a68b36e936c23969c41a2534 | |
parent | 5bd22b28fa4f743014bb7564a601c7fa8409d805 (diff) | |
download | gitlab-ce-948ebfeb013685b482a6afed5eab1355bd8f3171.tar.gz |
Provide @max_polling_steps instead of @limit_polling_interval
-rw-r--r-- | app/assets/javascripts/notes.js.coffee | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/app/assets/javascripts/notes.js.coffee b/app/assets/javascripts/notes.js.coffee index 88c9046a85c..1211614ae64 100644 --- a/app/assets/javascripts/notes.js.coffee +++ b/app/assets/javascripts/notes.js.coffee @@ -17,7 +17,7 @@ class @Notes @noteable_url = document.URL @notesCountBadge ||= $(".issuable-details").find(".notes-tab .badge") @base_polling_interval = 15000 - @limit_polling_interval = 120000 + @max_polling_steps = 5 @cleanBinding() @addBinding() @@ -127,9 +127,10 @@ class @Notes if there aren't new notes coming from the server ### setPollingInterval: (shouldReset = true) -> + nthInterval = @base_polling_interval * Math.pow(2, @max_polling_steps - 1) if shouldReset @polling_interval = @base_polling_interval - else if @polling_interval < @limit_polling_interval + else if @polling_interval < nthInterval @polling_interval *= 2 @initRefresh() |