Clear timers in update-times service
It's mostly relevant in tests, because service is destroyed when test end and then we don't want to run any timers.
This commit is contained in:
parent
bfb1b69374
commit
fa7c275eaa
|
@ -6,12 +6,18 @@ export default Ember.Service.extend({
|
||||||
allowFinishedBuilds: false,
|
allowFinishedBuilds: false,
|
||||||
|
|
||||||
init() {
|
init() {
|
||||||
Visibility.every(Config.intervals.updateTimes, this.updateTimes.bind(this));
|
this.set('visibilityId', Visibility.every(Config.intervals.updateTimes, this.updateTimes.bind(this)));
|
||||||
setInterval(this.resetAllowFinishedBuilds.bind(this), 60000);
|
this.set('intervalId', setInterval(this.resetAllowFinishedBuilds.bind(this), 60000));
|
||||||
|
|
||||||
return this._super(...arguments);
|
return this._super(...arguments);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
willDestroy() {
|
||||||
|
Visibility.stop(this.get('visibilityId'));
|
||||||
|
clearInterval(this.get('intervalId'));
|
||||||
|
this._super(...arguments);
|
||||||
|
},
|
||||||
|
|
||||||
resetAllowFinishedBuilds() {
|
resetAllowFinishedBuilds() {
|
||||||
this.set('allowFinishedBuilds', true);
|
this.set('allowFinishedBuilds', true);
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue
Block a user