UI: Add check for renewal time before triggering renew-self (#13950)
This commit is contained in:
parent
5804da7490
commit
4545643be2
|
@ -0,0 +1,3 @@
|
|||
```release-note:bug
|
||||
ui: trigger token renewal if inactive and half of TTL has passed
|
||||
```
|
|
@ -292,9 +292,10 @@ export default Service.extend({
|
|||
},
|
||||
|
||||
setLastFetch(timestamp) {
|
||||
const now = this.now();
|
||||
this.set('lastFetch', timestamp);
|
||||
// if expiration was allowed we want to go ahead and renew here
|
||||
if (this.allowExpiration) {
|
||||
// if expiration was allowed and we're over half the ttl we want to go ahead and renew here
|
||||
if (this.allowExpiration && now >= this.renewAfterEpoch) {
|
||||
this.renew();
|
||||
}
|
||||
this.set('allowExpiration', false);
|
||||
|
|
Loading…
Reference in New Issue