Skip to content

Commit

Permalink
Increased default refresh interval - 5 mins is a reasonable minimum f…
Browse files Browse the repository at this point in the history
…or most apps & avoids too many calls to backend.
  • Loading branch information
cip8 committed Aug 29, 2024
1 parent c8fc291 commit f3b0b1c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/runtime/utils/refreshHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,10 @@ export class DefaultRefreshHandler implements RefreshHandler {
document.addEventListener('visibilitychange', this.boundVisibilityHandler, false)

const { enablePeriodically } = this.config
const defaultRefreshInterval = 5 * 60 * 1000 // 5 minutes, in ms

if (enablePeriodically !== false) {
const intervalTime = enablePeriodically === true ? 1000 : enablePeriodically
const intervalTime = enablePeriodically === true ? defaultRefreshInterval : enablePeriodically
this.refetchIntervalTimer = setInterval(() => {
if (this.auth?.data.value) {
this.auth.refresh()
Expand Down

0 comments on commit f3b0b1c

Please sign in to comment.