Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ The following emojis are used to highlight certain changes:

### Changed

- fix(`provider`): don't reprovide if `reprovideInterval` is set to 0 [#871](https://github.com/ipfs/boxo/pull/871)

### Removed

### Fixed
Expand Down
5 changes: 5 additions & 0 deletions provider/reprovider.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ type reprovider struct {
closewg sync.WaitGroup
mu sync.Mutex

// reprovideInterval is the time between 2 reprovides. A value of 0 means
// that no automatic reprovide will be performed.
reprovideInterval time.Duration
initalReprovideDelay time.Duration
initialReprovideDelaySet bool
Expand Down Expand Up @@ -533,6 +535,9 @@ func (s *reprovider) getLastReprovideTime() (time.Time, error) {
}

func (s *reprovider) shouldReprovide() bool {
if s.reprovideInterval == 0 {
return false
}
t, err := s.getLastReprovideTime()
if err != nil {
log.Debugf("getting last reprovide time failed: %s", err)
Expand Down
Loading