Skip to content

Commit

Permalink
ir: Allow resetting cached state of an IR node
Browse files Browse the repository at this point in the history
Signed-off-by: Pavel Karpy <[email protected]>
  • Loading branch information
notimetoname committed Jun 26, 2023
1 parent 5f949c0 commit 429e23a
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions pkg/innerring/indexer.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,16 @@ func (s *innerRingIndexer) update() (ind indexes, err error) {
return s.ind, nil
}

func (s *innerRingIndexer) reset() {
s.Lock()
defer s.Unlock()

// zero time, every real time is expected to
// be _much later_ after that time; `update`
// will be forced to make RPC calls
s.lastAccess = time.Time{}
}

func (s *innerRingIndexer) InnerRingIndex() (int32, error) {
ind, err := s.update()
if err != nil {
Expand Down

0 comments on commit 429e23a

Please sign in to comment.