fixed issue with axios_utils not reducing activeVueResources variable when request fails
This commit is contained in:
parent
135a02cf42
commit
645d635976
|
@ -9,6 +9,7 @@ export default class Job {
|
|||
constructor(options) {
|
||||
this.timeout = null;
|
||||
this.state = null;
|
||||
this.fetchingStatusFavicon = false;
|
||||
this.options = options || $('.js-build-options').data();
|
||||
|
||||
this.pagePath = this.options.pagePath;
|
||||
|
@ -178,7 +179,17 @@ export default class Job {
|
|||
.then((res) => {
|
||||
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) {
|
||||
this.state = log.state;
|
||||
|
|
|
@ -19,6 +19,10 @@ axios.interceptors.response.use((config) => {
|
|||
window.activeVueResources -= 1;
|
||||
|
||||
return config;
|
||||
}, (e) => {
|
||||
window.activeVueResources -= 1;
|
||||
|
||||
return Promise.reject(e);
|
||||
});
|
||||
|
||||
export default axios;
|
||||
|
|
Loading…
Reference in New Issue