From 1b09bf2c495ce9575e2c5521b6b5657df679fbe1 Mon Sep 17 00:00:00 2001 From: "insanity@loafle.com" Date: Tue, 23 May 2017 11:13:46 +0900 Subject: [PATCH] poller --- poller.go | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/poller.go b/poller.go index b55ac11..e86eb60 100644 --- a/poller.go +++ b/poller.go @@ -3,12 +3,12 @@ package long_poller_go import ( cm "loafle.com/overflow/agent_api/config_manager" //pb "loafle.com/overflow/crawler_go/grpc" //temp + "loafle.com/overflow/agent_api/messages" s "loafle.com/overflow/scheduler_go" "log" "strconv" "sync" "time" - "loafle.com/overflow/agent_api/messages" ) const ( @@ -90,6 +90,7 @@ func (p *Poller) stop() { } var once1 sync.Once + func (p *Poller) polling(agentId string) { go func() { @@ -97,7 +98,6 @@ func (p *Poller) polling(agentId string) { time.Sleep(time.Second * 20) - once1.Do(func() { newTask := messages.AgentTask{} @@ -109,9 +109,6 @@ func (p *Poller) polling(agentId string) { p.taskCh <- newTask }) - - - /* addr := p.gconf.Central.Address + ":" + string(p.gconf.Central.Port) conn, err := grpc.Dial(addr, grpc.WithInsecure())