Skip to content

Commit

Permalink
Add some logging statements
Browse files Browse the repository at this point in the history
  • Loading branch information
brawer committed May 14, 2024
1 parent b037fdb commit 841e457
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion cmd/qrank-builder/itemsignals.go
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ func buildItemSignals(ctx context.Context, pageviews []string, sites *map[string
for merger.Advance() {
if err := joiner.Process(merger.Line()); err != nil {
joiner.Close()
logger.Printf("ItemSignalsJoiner.Process() failed: %v", err)
return err
}
}
Expand All @@ -209,9 +210,14 @@ func buildItemSignals(ctx context.Context, pageviews []string, sites *map[string
return groupCtx.Err()
case s, more := <-outChan:
if !more {
return writer.Close()
err := writer.Close()
if err != nil {
logger.Printf("ItemSignalsWriter.Close() failed: %v", err)
}
return err
}
if err := writer.Write(s.(ItemSignals)); err != nil {
logger.Printf("ItemSignalsWriter.Write() failed: %v", err)
return err
}
}
Expand Down

0 comments on commit 841e457

Please sign in to comment.