Skip to content

Commit

Permalink
closing feed when drain already closed
Browse files Browse the repository at this point in the history
  • Loading branch information
Termina1 committed Sep 12, 2024
1 parent a173527 commit ed7b3e8
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions sync.go
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,10 @@ func (sync *Syncer) GetDrainState() SyncState {
}

func (sync *Syncer) Feed(ctx context.Context) (recs protocol.Records, err error) {
// other side closed the connection already
if sync.GetDrainState() == SendNone {
sync.SetFeedState(ctx, SendNone)
}
switch sync.GetFeedState() {
case SendHandshake:
recs, err = sync.FeedHandshake()
Expand Down

0 comments on commit ed7b3e8

Please sign in to comment.