err fix
This commit is contained in:
parent
92ee474889
commit
f5dffb050d
|
@ -67,7 +67,7 @@ func (c *Collector) collect(id string) {
|
||||||
conf := c.cm.GetSensorById(id)
|
conf := c.cm.GetSensorById(id)
|
||||||
conn, err := crm.GetInstance().GetClient(conf.Crawler.Container)
|
conn, err := crm.GetInstance().GetClient(conf.Crawler.Container)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Println(err)
|
log.Error(err)
|
||||||
}
|
}
|
||||||
defer conn.Close()
|
defer conn.Close()
|
||||||
|
|
||||||
|
@ -81,12 +81,12 @@ func (c *Collector) collect(id string) {
|
||||||
out, err := dc.Get(context.Background(), in)
|
out, err := dc.Get(context.Background(), in)
|
||||||
finishedAt := time.Now().Unix()
|
finishedAt := time.Now().Unix()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Printf("Cannot collect [ID: %s] [Crawler : %s] - [Err : %s]\n", conf.Id, conf.Crawler.Name, err.Error())
|
log.Error("Cannot collect [ID: %s] [Crawler : %s] - [Err : %s]\n", conf.Id, conf.Crawler.Name, err.Error())
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
out.StartDate = startAt
|
out.StartDate = startAt
|
||||||
out.EndDate = finishedAt
|
out.EndDate = finishedAt
|
||||||
log.Printf("COLLECTED. [ID: %s] [Crawler : %s] [Result : %s]\n", conf.Id, conf.Crawler.Name, out.GetData())
|
log.Error("COLLECTED. [ID: %s] [Crawler : %s] [Result : %s]\n", conf.Id, conf.Crawler.Name, out.GetData())
|
||||||
c.dataCh <- out
|
c.dataCh <- out
|
||||||
}()
|
}()
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user