Merge remote-tracking branch 'origin/master'

This commit is contained in:
insanity@loafle.com 2017-04-17 17:20:33 +09:00
commit 7b4cf8f2b9

View File

@ -12,7 +12,9 @@ import (
"path/filepath"
"strings"
"time"
//crm "loafle.com/overflow/crawler_manager_go"
crm "loafle.com/overflow/crawler_manager_go"
"context"
g "loafle.com/overflow/crawler_go/grpc"
)
const CONFIG_ROOT = "/config/container"
@ -48,24 +50,24 @@ func (c *Collector) collect(id string) {
log.Printf("COLLECT %s - [ID: %s] [Crawler : %s]", time.Now(), conf.Id, conf.Crawler.Name)
//conn, err := crm.GetClient(conf.Crawler.Container)
//if err != nil {
// log.Println(err)
//}
//defer conn.Close()
conn, err := crm.GetInstance().GetClient(conf.Crawler.Container)
if err != nil {
log.Println(err)
}
defer conn.Close()
//dc := g.NewDataClient(conn);
//in := &g.Input{}
//
//in.Id = id
//in.Name = g.Crawlers_HEALTH_MONGODB
//
//out, err := dc.Get(context.Background(), in)
//
//if err != nil {
// log.Println(err)
//}
//log.Println(out)
dc := g.NewDataClient(conn);
in := &g.Input{}
in.Id = id
in.Name = g.Crawlers(g.Crawlers_value[conf.Crawler.Name])
out, err := dc.Get(context.Background(), in)
if err != nil {
log.Println(err)
}
log.Println(out)
}
//func (c *Collector) AddSensor(path string) {