diff --git a/core/candle.go b/core/candle.go index 04d6892..f72619f 100644 --- a/core/candle.go +++ b/core/candle.go @@ -244,9 +244,8 @@ func (core *Core) SaveUniKey(period string, keyName string, extt time.Duration, Content: cd, Tag: "sardine.log.candle." + cl.Period, } - go func() { - core.WriteLogChan <- &wg - }() + err := wg.Process(core) + fmt.Println("writeLog err:", err) core.SaveToSortSet(period, keyName, extt, tsi) } diff --git a/core/core.go b/core/core.go index 1e65eef..6aa3041 100644 --- a/core/core.go +++ b/core/core.go @@ -72,15 +72,6 @@ func (rst *RestQueue) Save(cr *Core) { cr.SaveCandle(rst.InstId, rst.Bar, rsp, rst.Duration, rst.WithWs) } -func WriteLogProcess(cr *Core) { - for { - wg := <-cr.WriteLogChan - go func(wg *WriteLog) { - wg.Process(cr) - }(wg) - } -} - func (cr *Core) ShowSysTime() { rsp, _ := cr.RestInvoke("/api/v5/public/time", rest.GET) fmt.Println("serverSystem time:", rsp) diff --git a/main.go b/main.go index 563d247..74947d1 100644 --- a/main.go +++ b/main.go @@ -231,10 +231,6 @@ func main() { go func() { LoopSaveCandle(&cr) }() - - go func() { - core.WriteLogProcess(&cr) - }() // 永久阻塞 select {} } diff --git a/tunas b/tunas index a6c8b62..d13dba9 100755 Binary files a/tunas and b/tunas differ