Skip to content

Commit

Permalink
fix: addressing PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Wondertan committed Jun 7, 2021
1 parent 58b3199 commit a1e34d1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
1 change: 0 additions & 1 deletion ipfs/mock.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,4 @@ type dagOnlyMock struct {
}

func (dom dagOnlyMock) Dag() coreiface.APIDagService { return dom }
func (dagOnlyMock) Close() error { return nil }
func (dom dagOnlyMock) Pinning() ipld.NodeAdder { return dom }
10 changes: 5 additions & 5 deletions p2p/ipld/write.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,9 @@ type provider struct {
jobs chan cid.Cid
total int32

croute routing.ContentRouting
log log.Logger
took time.Time
croute routing.ContentRouting
log log.Logger
startTime time.Time
}

func newProvider(ctx context.Context, croute routing.ContentRouting, toProvide int32, logger log.Logger) *provider {
Expand All @@ -101,7 +101,7 @@ func newProvider(ctx context.Context, croute routing.ContentRouting, toProvide i
go p.worker()
}
logger.Info("Started Providing to DHT")
p.took = time.Now()
p.startTime = time.Now()
return p
}

Expand Down Expand Up @@ -158,7 +158,7 @@ func (p *provider) worker() {

func (p *provider) provided() {
if atomic.AddInt32(&p.total, -1) == 0 {
p.log.Info("Finished providing to DHT", "took", time.Since(p.took).String())
p.log.Info("Finished providing to DHT", "took", time.Since(p.startTime).String())
close(p.done)
}
}

0 comments on commit a1e34d1

Please sign in to comment.