Skip to content

Commit

Permalink
properly clear out array
Browse files Browse the repository at this point in the history
  • Loading branch information
jonfung-dydx committed Aug 9, 2024
1 parent 0e94679 commit c6a3974
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions protocol/streaming/full_node_streaming_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,8 @@ func (sm *FullNodeStreamingManagerImpl) AddUpdatesToCache(
for id := range sm.orderbookSubscriptions {
sm.removeSubscription(id)
}
clear(sm.streamUpdateCache)
sm.streamUpdateCache = nil
sm.streamUpdateSubscriptionCache = nil
}
sm.EmitMetrics()
}
Expand Down Expand Up @@ -502,8 +503,8 @@ func (sm *FullNodeStreamingManagerImpl) FlushStreamUpdatesWithLock() {
}
}

clear(sm.streamUpdateCache)
clear(sm.streamUpdateSubscriptionCache)
sm.streamUpdateCache = nil
sm.streamUpdateSubscriptionCache = nil

for _, id := range idsToRemove {
sm.logger.Error(
Expand Down

0 comments on commit c6a3974

Please sign in to comment.