summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlfredo Sumaran <alfredo@gitlab.com>2016-03-02 18:23:36 -0500
committerAlfredo Sumaran <alfredo@gitlab.com>2016-03-03 15:20:01 -0500
commit948ebfeb013685b482a6afed5eab1355bd8f3171 (patch)
treedcaf1b8d2ba40ad1a68b36e936c23969c41a2534
parent5bd22b28fa4f743014bb7564a601c7fa8409d805 (diff)
downloadgitlab-ce-948ebfeb013685b482a6afed5eab1355bd8f3171.tar.gz
Provide @max_polling_steps instead of @limit_polling_interval
-rw-r--r--app/assets/javascripts/notes.js.coffee5
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()