chore: refactor (#5068)

This commit is contained in:
Kevin Wan
2025-08-08 23:30:03 +08:00
committed by GitHub
parent b46d507a1d
commit a2b98dbcf7
2 changed files with 11 additions and 8 deletions

View File

@@ -70,9 +70,8 @@ func (ir *ImmutableResource) Get() (any, error) {
}
func (ir *ImmutableResource) shouldRefresh() bool {
now := timex.Now()
lastTime := ir.lastTime.Load()
return lastTime == 0 || lastTime+ir.refreshInterval < now
return lastTime == 0 || lastTime+ir.refreshInterval < timex.Now()
}
// WithRefreshIntervalOnFailure sets refresh interval on failure.