Skip to content

Commit

Permalink
Move ctxWithTimeout into updateCache
Browse files Browse the repository at this point in the history
Co-authored-by: Jordan Krage <jmank88@gmail.com>
  • Loading branch information
ilija42 and jmank88 committed Apr 1, 2024
1 parent d0ae2a1 commit fedd223
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions core/services/ocrcommon/data_source.go
Original file line number Diff line number Diff line change
Expand Up @@ -255,9 +255,9 @@ func (ds *inMemoryDataSourceCache) Close() error {
// updater periodically updates data source cache.
func (ds *inMemoryDataSourceCache) updater() {
ticker := time.NewTicker(ds.cacheFreshness)
ctx, cancel := ds.chStop.CtxCancel(context.WithTimeout(context.Background(), time.Second*10))
defer cancel()
updateCache := func() {
ctx, cancel := ds.chStop.CtxCancel(context.WithTimeout(context.Background(), time.Second*10))
defer cancel()
if err := ds.updateCache(ctx); err != nil {
ds.lggr.Warnf("failed to update cache, err: %v", err)
}
Expand Down

0 comments on commit fedd223

Please sign in to comment.