Commit 645d6359 authored by Phil Hughes's avatar Phil Hughes

fixed issue with axios_utils not reducing activeVueResources variable when request fails

parent 135a02cf
...@@ -9,6 +9,7 @@ export default class Job { ...@@ -9,6 +9,7 @@ export default class Job {
constructor(options) { constructor(options) {
this.timeout = null; this.timeout = null;
this.state = null; this.state = null;
this.fetchingStatusFavicon = false;
this.options = options || $('.js-build-options').data(); this.options = options || $('.js-build-options').data();
this.pagePath = this.options.pagePath; this.pagePath = this.options.pagePath;
...@@ -178,7 +179,17 @@ export default class Job { ...@@ -178,7 +179,17 @@ export default class Job {
.then((res) => { .then((res) => {
const log = res.data; const log = res.data;
setCiStatusFavicon(`${this.pagePath}/status.json`); if (!this.fetchingStatusFavicon) {
this.fetchingStatusFavicon = true;
setCiStatusFavicon(`${this.pagePath}/status.json`)
.then(() => {
this.fetchingStatusFavicon = false;
})
.catch(() => {
this.fetchingStatusFavicon = false;
});
}
if (log.state) { if (log.state) {
this.state = log.state; this.state = log.state;
......
...@@ -19,6 +19,10 @@ axios.interceptors.response.use((config) => { ...@@ -19,6 +19,10 @@ axios.interceptors.response.use((config) => {
window.activeVueResources -= 1; window.activeVueResources -= 1;
return config; return config;
}, (e) => {
window.activeVueResources -= 1;
return Promise.reject(e);
}); });
export default axios; export default axios;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment