mirror of
https://github.com/zeromicro/go-zero.git
synced 2026-05-10 00:20:00 +08:00
chore: refactor (#5068)
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user