提交 11e7c419 编写于 作者: U UlricQin

add EngineDelay

上级 57c2fd9b
......@@ -4,6 +4,9 @@ RunMode = "release"
# my cluster name
ClusterName = "Default"
# sleep x seconds, then start judge engine
EngineDelay = 120
[Log]
# log write dir
Dir = "logs"
......
......@@ -62,6 +62,10 @@ func MustLoad(fpaths ...string) {
}
m.MustLoad(C)
if C.EngineDelay == 0 {
C.EngineDelay = 120
}
if C.Heartbeat.IP == "" {
// auto detect
C.Heartbeat.IP = fmt.Sprint(GetOutboundIP())
......@@ -85,6 +89,7 @@ func MustLoad(fpaths ...string) {
type Config struct {
RunMode string
ClusterName string
EngineDelay int64
Log logx.Config
HTTP httpx.Config
BasicAuth gin.Accounts
......
......@@ -20,7 +20,7 @@ import (
func loopFilterRules(ctx context.Context) {
// wait for samples
time.Sleep(time.Minute * 2)
time.Sleep(time.Duration(config.C.EngineDelay) * time.Second)
duration := time.Duration(9000) * time.Millisecond
for {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册