From 93b06f3469f8161f47256d5c6a2d600bcb2663ce Mon Sep 17 00:00:00 2001
From: Jeromy <jeromyj@gmail.com>
Date: Fri, 24 Apr 2015 11:47:56 -0700
Subject: [PATCH] Add timeout to ipns resolution at startup

---
 ipnsfs/system.go | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/ipnsfs/system.go b/ipnsfs/system.go
index f93757744..bdca87099 100644
--- a/ipnsfs/system.go
+++ b/ipnsfs/system.go
@@ -159,8 +159,10 @@ func (fs *Filesystem) newKeyRoot(parent context.Context, k ci.PrivKey) (*KeyRoot
 		}
 	}
 
-	mnode, err := fs.dserv.Get(ctx, pointsTo)
+	tctx, _ := context.WithTimeout(parent, time.Second*5)
+	mnode, err := fs.dserv.Get(tctx, pointsTo)
 	if err != nil {
+		log.Errorf("Failed to retreive value '%s' for ipns entry: %s\n", pointsTo, err)
 		return nil, err
 	}
 
-- 
GitLab