Skip to content

Commit

Permalink
fix expiry time for empty paths (#267)
Browse files Browse the repository at this point in the history
  • Loading branch information
JordiSubira authored Feb 3, 2025
1 parent cf1e1d5 commit f70181a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pkg/pan/pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,9 @@ func (e *pathPoolDst) update(paths []*Path) {
func (p *pathPool) earliestPathExpiry() time.Time {
p.entriesMutex.RLock()
defer p.entriesMutex.RUnlock()
if len(p.entries) == 0 {
return time.Time{}
}
ret := maxTime
for _, entry := range p.entries {
if entry.earliestExpiry.Before(ret) {
Expand All @@ -139,6 +142,9 @@ func (p *pathPool) earliestPathExpiry() time.Time {
}

func earliestPathExpiry(paths []*Path) time.Time {
if len(paths) == 0 {
return time.Time{}
}
ret := maxTime
for _, p := range paths {
expiry := p.Expiry
Expand Down

0 comments on commit f70181a

Please sign in to comment.