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)
|
||||
conn, err := crm.GetInstance().GetClient(conf.Crawler.Container)
|
||||
if err != nil {
|
||||
log.Println(err)
|
||||
log.Error(err)
|
||||
}
|
||||
defer conn.Close()
|
||||
|
||||
|
@ -81,12 +81,12 @@ func (c *Collector) collect(id string) {
|
|||
out, err := dc.Get(context.Background(), in)
|
||||
finishedAt := time.Now().Unix()
|
||||
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
|
||||
}
|
||||
out.StartDate = startAt
|
||||
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
|
||||
}()
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user