Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorFatih Acet <acetfatih@gmail.com>2016-09-06 19:33:24 +0300
committerRuben Davila <rdavila84@gmail.com>2016-09-06 19:52:28 +0300
commit8a70dcab94ddbf67fcd5350319b1aa1e0c8206f3 (patch)
treefe514d6a8b65912955dd8a5892e06ecd1bf323fe /app
parent1ea1bb6e76633b4303cb7eb561474375cbe77e50 (diff)
Merge branch 'improve-vuejs-resource-interceptor' into 'master'
Reduce intermittent spec failures by making VueJS resource interceptor decrement outstanding resource counts when HTTP response is received Before the count would be reduced 500 ms after a DOM update tick, which could cause race conditions since the `DatabaseCleaner` could run in the middle of a Rails controller handling the response. Partial fix to #21197 and other intermittent spec failures. See merge request !6224
Diffstat (limited to 'app')
-rw-r--r--app/assets/javascripts/boards/vue_resource_interceptor.js.es69
1 files changed, 3 insertions, 6 deletions
diff --git a/app/assets/javascripts/boards/vue_resource_interceptor.js.es6 b/app/assets/javascripts/boards/vue_resource_interceptor.js.es6
index f9f9f7999d4..b5ff3a81ed5 100644
--- a/app/assets/javascripts/boards/vue_resource_interceptor.js.es6
+++ b/app/assets/javascripts/boards/vue_resource_interceptor.js.es6
@@ -1,10 +1,7 @@
-Vue.http.interceptors.push((request, next) => {
+Vue.http.interceptors.push((request, next) => {
Vue.activeResources = Vue.activeResources ? Vue.activeResources + 1 : 1;
- Vue.nextTick(() => {
- setTimeout(() => {
- Vue.activeResources--;
- }, 500);
+ next(function (response) {
+ Vue.activeResources--;
});
- next();
});