Skip to content

Commit

Permalink
Make logging more verbose when computing item signal
Browse files Browse the repository at this point in the history
  • Loading branch information
brawer committed May 15, 2024
1 parent 841e457 commit 00ad13d
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions cmd/qrank-builder/itemsignals.go
Original file line number Diff line number Diff line change
Expand Up @@ -200,10 +200,16 @@ func buildItemSignals(ctx context.Context, pageviews []string, sites *map[string
}
}
joiner.Close()
return merger.Err()
logger.Printf("ItemSignalsJoiner: finished")
if err := merger.Err(); err != nil {
logger.Printf("LineMerger failed: %v", err)
return err
}
return nil
})
group.Go(func() error {
sorter.Sort(groupCtx)
logger.Printf("BuildItemSignals(): start sorting")
for {
select {
case <-groupCtx.Done():
Expand All @@ -227,9 +233,10 @@ func buildItemSignals(ctx context.Context, pageviews []string, sites *map[string
return time.Time{}, err
}
if err := <-errChan; err != nil {
logger.Printf("BuildItemSignals: sorting failed, err=%v", err)
return time.Time{}, err
}

logger.Printf("BuildItemSignals(): finished sorting")
for _, s := range scanners {
if closer, ok := s.(io.Closer); ok {
if err := closer.Close(); err != nil {
Expand Down

0 comments on commit 00ad13d

Please sign in to comment.