add EngineDelay
This commit is contained in:
parent
57c2fd9b73
commit
11e7c41908
|
@ -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 {
|
||||
|
|
Loading…
Reference in New Issue