|
@@ -22,15 +22,21 @@ func ListenReport2ImgQueue() {
|
|
|
defer func() {
|
|
|
if err := recover(); err != nil {
|
|
|
fmt.Println("[ListenReport2ImgQueue]", err)
|
|
|
+ utils.FileLog.Info(fmt.Sprintf("[ListenReport2ImgQueue] recover: %v", err))
|
|
|
}
|
|
|
}()
|
|
|
for {
|
|
|
+ if utils.Re != nil {
|
|
|
+ utils.FileLog.Info(fmt.Sprintf("[ListenReport2ImgQueue] Re err: %s", utils.Re.Error()))
|
|
|
+ continue
|
|
|
+ }
|
|
|
utils.Rc.Brpop(utils.CACHE_CREATE_REPORT_IMGPDF_QUEUE, func(b []byte) {
|
|
|
- fmt.Println("ListenReport2ImgQueue Brpop:" + string(b))
|
|
|
var req Report2ImgQueueReq
|
|
|
- err := json.Unmarshal(b, &req)
|
|
|
- if err != nil {
|
|
|
- fmt.Println("ListenReport2ImgQueue json.Unmarshal Err:" + err.Error())
|
|
|
+ if e := json.Unmarshal(b, &req); e != nil {
|
|
|
+ t := fmt.Sprintf("[ListenReport2ImgQueue] Unmarshal err: %s, b: %s", e.Error(), string(b))
|
|
|
+ fmt.Println(t)
|
|
|
+ utils.FileLog.Info(t)
|
|
|
+ return
|
|
|
}
|
|
|
CreateReportImgAndPdf(req)
|
|
|
})
|