Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
Signed-off-by: Keran Yang <[email protected]>
  • Loading branch information
KeranYang committed Jan 13, 2025
1 parent 8ba128f commit d1aaa02
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions pkg/sources/generator/tickgen.go
Original file line number Diff line number Diff line change
Expand Up @@ -198,12 +198,9 @@ loop:
// we implement Read With Wait semantics
select {
case r, ok := <-mg.srcChan:
// when the channel is closed and empty, go will still read from the channel once and return the zero value.
// exclude the zero value from being passed to the next vertex,
// ensuring all messages produced by generator follow the same data schema.
if !ok {
mg.logger.Info("Zero value read from the generator channel, skipping...")
continue
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:
Expand Down

0 comments on commit d1aaa02

Please sign in to comment.