Skip to content

Commit

Permalink
Merge pull request #140 from s7techlab/seek-from-callback-bugfix
Browse files Browse the repository at this point in the history
seek-from-callback-bugfix
  • Loading branch information
vitiko committed Nov 21, 2023
2 parents 82bbf13 + 2920451 commit 3cbe1ea
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion observer/block_peer_common.go
Original file line number Diff line number Diff line change
Expand Up @@ -193,9 +193,11 @@ func (bp *BlockPeer) initChannels(ctx context.Context) {
func (bp *BlockPeer) getSeekFrom(channel string) SeekFromFetcher {
seekFrom := ChannelSeekOldest()
// at first check seekFrom var, if it is empty, check seekFromFetcher
bp.mu.Lock()
seekFromNum, exist := bp.seekFrom[channel]
bp.mu.Unlock()
if exist {
seekFrom = ChannelSeekFrom(seekFromNum)
seekFrom = ChannelSeekFrom(seekFromNum - 1)
} else {
// if seekFromFetcher is also empty, use ChannelSeekOldest
if bp.seekFromFetcher != nil {
Expand Down

0 comments on commit 3cbe1ea

Please sign in to comment.