mirror of
https://github.com/Sagit-chu/flvx.git
synced 2026-10-04 09:06:38 +08:00
修复流量统计
This commit is contained in:
@@ -8,6 +8,7 @@ import (
|
||||
"os/signal"
|
||||
"strings"
|
||||
"syscall"
|
||||
"time"
|
||||
|
||||
"github.com/go-gost/core/auth"
|
||||
"github.com/go-gost/core/logger"
|
||||
@@ -21,6 +22,7 @@ import (
|
||||
xmetrics "github.com/go-gost/x/metrics"
|
||||
metrics "github.com/go-gost/x/metrics/service"
|
||||
"github.com/go-gost/x/registry"
|
||||
xservice "github.com/go-gost/x/service"
|
||||
"github.com/judwhite/go-svc"
|
||||
)
|
||||
|
||||
@@ -73,6 +75,16 @@ func (p *program) Start() error {
|
||||
p.cancel = cancel
|
||||
go p.reload(ctx)
|
||||
|
||||
// 延迟启动配置定时上报器(等待30秒让WebSocket连接稳定)
|
||||
go func() {
|
||||
select {
|
||||
case <-time.After(10 * time.Second):
|
||||
xservice.StartConfigReporter(ctx)
|
||||
case <-ctx.Done():
|
||||
return
|
||||
}
|
||||
}()
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user