Skip to content
This repository has been archived by the owner on Mar 15, 2024. It is now read-only.

Commit

Permalink
Add logging to heyfil / mongo reporting
Browse files Browse the repository at this point in the history
  • Loading branch information
willscott committed Aug 1, 2023
1 parent 2e6062f commit d246c9f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
5 changes: 4 additions & 1 deletion eventrecorder/recorder.go
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,10 @@ func (r *EventRecorder) RecordAggregateEvents(ctx context.Context, events []Aggr
mongoReportCtx, cncl := context.WithTimeout(context.Background(), 30*time.Second)
defer cncl()
var pid peer.ID
pid.UnmarshalText([]byte(reportData.StorageProviderID))
if err := pid.UnmarshalText([]byte(reportData.StorageProviderID)); err != nil {
logger.Warnf("could not parse spid %s: %s", reportData.StorageProviderID, err)
return
}
SPID, ok := <-r.pmap.Get(mongoReportCtx, pid)
if ok {
reportData.SPID = SPID
Expand Down
1 change: 1 addition & 0 deletions spmap/spmap.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ func (s *SPMap) query(ctx context.Context, id peer.ID) []string {
logger.Warnf("failed to decode response from heyfil: %w", err)
return nil
}
logger.Infof("heyfil mapped %d sps for peerID %s", len(sps), id.String())
return sps
}

Expand Down

0 comments on commit d246c9f

Please sign in to comment.