根据环境变量配置,有条件的执行saveCandle

This commit is contained in:
zhangkun 2024-12-10 16:19:28 +08:00
parent e75badf1b7
commit 6f3be66181
2 changed files with 8 additions and 4 deletions

View File

@ -1,13 +1,13 @@
package core
import (
"crypto/sha256"
"encoding/hex"
"encoding/json"
"errors"
"fmt"
"math/rand"
// "os"
"crypto/sha256"
"encoding/hex"
"os"
"strconv"
"strings"
"time"
@ -164,7 +164,11 @@ func (core *Core) SaveCandle(instId string, period string, rsp *CandleData, dura
Data: v,
From: "rest",
}
candle.SetToKey(core)
//保存rest得到的candle
saveCandle := os.Getenv("TEXUS_SAVECANDLE")
if saveCandle == "true" {
candle.SetToKey(core)
}
// 发布到allCandles|publish, 给外部订阅者用于setToKey
arys := []string{ALLCANDLES_PUBLISH}
if withWs {

BIN
texus

Binary file not shown.