This commit is contained in:
zhangkun 2024-12-02 23:20:56 +08:00
parent 461dac8d88
commit 2b7e5e6a1a
4 changed files with 2 additions and 16 deletions

View File

@ -244,9 +244,8 @@ func (core *Core) SaveUniKey(period string, keyName string, extt time.Duration,
Content: cd, Content: cd,
Tag: "sardine.log.candle." + cl.Period, Tag: "sardine.log.candle." + cl.Period,
} }
go func() { err := wg.Process(core)
core.WriteLogChan <- &wg fmt.Println("writeLog err:", err)
}()
core.SaveToSortSet(period, keyName, extt, tsi) core.SaveToSortSet(period, keyName, extt, tsi)
} }

View File

@ -72,15 +72,6 @@ func (rst *RestQueue) Save(cr *Core) {
cr.SaveCandle(rst.InstId, rst.Bar, rsp, rst.Duration, rst.WithWs) 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() { func (cr *Core) ShowSysTime() {
rsp, _ := cr.RestInvoke("/api/v5/public/time", rest.GET) rsp, _ := cr.RestInvoke("/api/v5/public/time", rest.GET)
fmt.Println("serverSystem time:", rsp) fmt.Println("serverSystem time:", rsp)

View File

@ -231,10 +231,6 @@ func main() {
go func() { go func() {
LoopSaveCandle(&cr) LoopSaveCandle(&cr)
}() }()
go func() {
core.WriteLogProcess(&cr)
}()
// 永久阻塞 // 永久阻塞
select {} select {}
} }

BIN
tunas

Binary file not shown.