Merge pull request #676 from ipfs/fix/cancelled-context-repo-stat

Fix context cancelled too early.
This commit is contained in:
Hector Sanjuan 2019-02-17 20:58:37 +00:00 committed by GitHub
commit dcd8bb85d1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -683,8 +683,9 @@ func (ipfs *Connector) shouldUpdateMetric() bool {
// Trigger a broadcast of the local informer metrics. // Trigger a broadcast of the local informer metrics.
func (ipfs *Connector) updateInformerMetric(ctx context.Context) error { func (ipfs *Connector) updateInformerMetric(ctx context.Context) error {
ctx, span := trace.StartSpan(ctx, "ipfsconn/ipfshttp/updateInformerMetric") _, span := trace.StartSpan(ctx, "ipfsconn/ipfshttp/updateInformerMetric")
defer span.End() defer span.End()
ctx = trace.NewContext(ipfs.ctx, span)
if !ipfs.shouldUpdateMetric() { if !ipfs.shouldUpdateMetric() {
return nil return nil