@cryptotaxi247 / kubo / commits / 93b06f346

Add timeout to ipns resolution at startup

Jeromy committed Apr 24, 2015 at 11:47 UTC 93b06f3469f8161f47256d5c6a2d600bcb2663ce
1 file changed +3 -1
ipnsfs/system.go
+3 -1
@@ -159,8 +159,10 @@ func (fs *Filesystem) newKeyRoot(parent context.Context, k ci.PrivKey) (*KeyRoot
159 }
160 }
161
162 - mnode, err := fs.dserv.Get(ctx, pointsTo)
162 + tctx, _ := context.WithTimeout(parent, time.Second*5)
163 + mnode, err := fs.dserv.Get(tctx, pointsTo)
164 if err != nil {
165 + log.Errorf("Failed to retreive value '%s' for ipns entry: %s\n", pointsTo, err)
166 return nil, err
167 }
168