From cef4bac1f97067880cd4338c8dc3b428679c5680 Mon Sep 17 00:00:00 2001 From: jiangyong Date: Sat, 27 Apr 2024 23:43:21 +0800 Subject: [PATCH] logErrof notify --- cmd/film.go | 4 ++-- worker/haha/haha_sync_order.go | 2 +- worker/nowcar/nowcar.go | 6 ++++++ 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/cmd/film.go b/cmd/film.go index acc0cbb..09f5f29 100644 --- a/cmd/film.go +++ b/cmd/film.go @@ -44,7 +44,7 @@ func initLog() { log.SetLevel(log.Level(cfg.Server.LogLevel)) } -func main2() { +func main() { config.LoadServerConfig() config.LoadDadiConfig() config.LoadHahaConfig() @@ -56,7 +56,7 @@ func main2() { work.Run() } -func main() { +func main2() { config.LoadServerConfig() config.LoadDadiConfig() config.LoadHahaConfig() diff --git a/worker/haha/haha_sync_order.go b/worker/haha/haha_sync_order.go index 5f47ba3..37f115d 100644 --- a/worker/haha/haha_sync_order.go +++ b/worker/haha/haha_sync_order.go @@ -60,7 +60,7 @@ func (s *SyncOrder) Sync() { } var arrs []interface{} if err := json.Unmarshal([]byte(originText), &arrs); err != nil { - log.Errorf("json.Unmarsha error :%s", err.Error()) + //log.Errorf("json.Unmarsha error :%s", err.Error()) return } for _, d := range arrs { diff --git a/worker/nowcar/nowcar.go b/worker/nowcar/nowcar.go index d856823..f7cd29e 100644 --- a/worker/nowcar/nowcar.go +++ b/worker/nowcar/nowcar.go @@ -6,6 +6,7 @@ import ( "film/model" "fmt" log "github.com/sirupsen/logrus" + "github.com/smbrave/goutil" "github.com/tidwall/gjson" "io" "net/http" @@ -90,7 +91,12 @@ func getInfo(devId string) ([]string, error) { err = dao.NewNowCarDao().Update(m2) if err != nil { log.Errorf("db error :%s", err.Error()) + continue } + //订单完成提示 + log.Errorf("shopName=%s workstation=%s time=[%s-%s]", + m2.ShopName, m2.Workstation, goutil.TimeToDateTime(m2.StartTime), + goutil.TimeToDateTime(m2.EndTime)) } }