From 448365806c71a37ebaf913adc0d2c3de2e3e7d79 Mon Sep 17 00:00:00 2001 From: Yousong Zhou Date: Wed, 26 Jun 2019 11:58:00 +0000 Subject: [PATCH] =?UTF-8?q?lbagent:=20=E5=90=AF=E5=8A=A8=E6=97=B6=E5=85=A8?= =?UTF-8?q?=E9=87=8F=E5=8F=96API=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 此变更之后,data/目录内容更多服务于调试作用 --- pkg/lbagent/api.go | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/pkg/lbagent/api.go b/pkg/lbagent/api.go index b38f10cb9d..62ce044357 100644 --- a/pkg/lbagent/api.go +++ b/pkg/lbagent/api.go @@ -195,20 +195,22 @@ func (h *ApiHelper) agentPeek(ctx context.Context) *agentPeekResult { func (h *ApiHelper) runInit(ctx context.Context) { h.haState = <-h.haStateProvider.StateChannel() - r := h.agentPeek(ctx) - if r == nil { - return - } - if !r.staleInFuture(h.opts.ApiLbagentHbTimeoutRelaxation) { - log.Warningf("agent will stale in %d seconds, ignore old corpus", - h.opts.ApiLbagentHbTimeoutRelaxation) - } else { - h.doHb(ctx) - corpus, err := h.loadLocalData(ctx) - if err == nil { - h.corpus = corpus + if false { + r := h.agentPeek(ctx) + if r == nil { + return + } + if !r.staleInFuture(h.opts.ApiLbagentHbTimeoutRelaxation) { + log.Warningf("agent will stale in %d seconds, ignore old corpus", + h.opts.ApiLbagentHbTimeoutRelaxation) } else { - log.Errorf("load local api data failed: %s", err) + h.doHb(ctx) + corpus, err := h.loadLocalData(ctx) + if err == nil { + h.corpus = corpus + } else { + log.Errorf("load local api data failed: %s", err) + } } } // better reload now because agent data is not in corpus yet