bzp2010 commented on code in PR #2650:
URL: https://github.com/apache/apisix-dashboard/pull/2650#discussion_r1007833043
##########
api/cmd/root.go:
##########
@@ -81,3 +89,59 @@ func manageAPI() error {
}
return nil
}
+
+func etcdConnectionChecker() context.CancelFunc {
+ ctx, cancel := context.WithCancel(context.TODO())
+ unavailableTimes := 0
+
+ go func() {
+ etcdClient := storage.GenEtcdStorage().GetClient()
+ for {
+ select {
+ case <-time.Tick(10 * time.Second):
+ sCtx, sCancel :=
context.WithTimeout(context.TODO(), 5*time.Second)
Review Comment:
This means applying a separate timeout for each request instead of using
that global one ctx, which is used to turn off the timer.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]