diff options
author | Jacob Schatz <jschatz@gitlab.com> | 2016-05-25 14:51:20 +0300 |
---|---|---|
committer | Yorick Peterse <yorickpeterse@gmail.com> | 2016-05-25 16:00:03 +0300 |
commit | 820c1c3abc80570e7d87a442670df4c8305c267b (patch) | |
tree | cb486647f821d54ff40a86e9db14fb2ad9056235 /app | |
parent | 4e8798eef0076ee9486f61ad14094c68334c45d1 (diff) |
Merge branch 'incremental-fixes' into 'master'
Fix concurrent request when updating build log in browser
If you have a slow internet connection the trace will not be updated correctly. We need to check if our request is the latest one.
Fixes: https://gitlab.com/gitlab-org/gitlab-ce/issues/17535
See merge request !4183
Diffstat (limited to 'app')
-rw-r--r-- | app/assets/javascripts/ci/build.coffee | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/app/assets/javascripts/ci/build.coffee b/app/assets/javascripts/ci/build.coffee index fca0c3bae5c..98d05e41273 100644 --- a/app/assets/javascripts/ci/build.coffee +++ b/app/assets/javascripts/ci/build.coffee @@ -28,12 +28,15 @@ class CiBuild # CiBuild.interval = setInterval => if window.location.href.split("#").first() is build_url + last_state = @state $.ajax url: build_url + "/trace.json?state=" + encodeURIComponent(@state) dataType: "json" success: (log) => - @state = log.state - if log.status is "running" + return unless last_state is @state + + if log.state and log.status is "running" + @state = log.state if log.append $('.fa-refresh').before log.html else |