diff --git a/collector.go b/collector.go index 196eb28..0f0e105 100644 --- a/collector.go +++ b/collector.go @@ -75,11 +75,13 @@ func (c *Collector) collect(id string) { in.Id = id in.Name = grpc.Crawlers(grpc.Crawlers_value[conf.Crawler.Name]) + out, err := dc.Get(context.Background(), in) if err != nil { - log.Printf("Cannot collect [ID: %s] [Crawler : %s] - [Err : %s]\n", conf.Id, conf.Crawler.Name, err) + log.Printf("Cannot collect [ID: %s] [Crawler : %s] - [Err : %s]\n", conf.Id, conf.Crawler.Name, err.Error()) + return } - log.Printf("COLLECTED. [ID: %s] [Crawler : %s] [Result : %s]\n", conf.Id, conf.Crawler.Name, out.GetData() ) + log.Printf("COLLECTED. [ID: %s] [Crawler : %s] [Result : %s]\n", conf.Id, conf.Crawler.Name, out.GetData()) c.dataCh <- out }() }