comments from CR
License: MIT Signed-off-by: Jeromy <jeromyj@gmail.com>
Jeromy committed
Jun 11, 2015 at 13:34 UTC
e014a66bf5653a03a9bce31f18ebdfc073faa807
1 file changed
+6
-6
exchange/bitswap/wantmanager.go
+6
-6
@@ -145,10 +145,10 @@ func (mq *msgQueue) runQueue(ctx context.Context) {
145
}
146
147
func (mq *msgQueue) doWork(ctx context.Context) {
148
- // allow a minute for connections
148
+ // allow ten minutes for connections
149
// this includes looking them up in the dht
150
// dialing them, and handshaking
151
- conctx, cancel := context.WithTimeout(ctx, time.Minute)
151
+ conctx, cancel := context.WithTimeout(ctx, time.Minute*10)
152
defer cancel()
153
154
err := mq.network.ConnectTo(conctx, mq.p)
@@ -161,14 +161,14 @@ func (mq *msgQueue) doWork(ctx context.Context) {
161
// grab outgoing message
162
mq.outlk.Lock()
163
wlm := mq.out
164
- mq.out = nil
165
- mq.outlk.Unlock()
166
-
164
if wlm == nil || wlm.Empty() {
165
+ mq.outlk.Unlock()
166
return
167
}
168
+ mq.out = nil
169
+ mq.outlk.Unlock()
170
171
- sendctx, cancel := context.WithTimeout(ctx, time.Second*30)
171
+ sendctx, cancel := context.WithTimeout(ctx, time.Minute*5)
172
defer cancel()
173
174
// send wantlist updates