Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: skip publishing the last empty struct when generator stops #2327

Merged
merged 4 commits into from
Jan 13, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion pkg/sources/generator/tickgen.go
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,11 @@ loop:
// since the Read call is blocking, and runs in an infinite loop,
// we implement Read With Wait semantics
select {
case r := <-mg.srcChan:
case r, ok := <-mg.srcChan:
if !ok {
mg.logger.Info("All the messages have been read. returning.")
break loop
}
msgs = append(msgs, mg.newReadMessage(r.key, r.data, r.offset, r.ts))
case <-timeout:
break loop
Expand Down
Loading