浏览代码

fix retry connection

sainw 3 年之前
父节点
当前提交
c11b2de2f2
共有 1 个文件被更改,包括 2 次插入4 次删除
  1. 2 4
      client/client.go

+ 2 - 4
client/client.go

@@ -111,17 +111,15 @@ start:
 		if ok {
 			if statusCode.Code() == codes.Unauthenticated {
 				return nil, err
-			} else if statusCode.Code() == codes.Unavailable {
+			} else {
 				log.Println("Retrying stream")
 				for {
-					time.Sleep(time.Second * 1)
+					time.Sleep(time.Second * 3)
 					err := s.assignStream()
 					if err == nil {
 						goto start
 					}
 				}
-			} else {
-				return nil, err
 			}
 		}
 	}