feat: pulse interval can be 0

This commit is contained in:
langhuihui
2025-07-11 16:23:00 +08:00
parent 131af312f1
commit 17faf3f064

View File

@@ -5,7 +5,6 @@ import (
"context"
"errors"
"fmt"
"gopkg.in/yaml.v3"
"log/slog"
"net"
"net/http"
@@ -16,6 +15,8 @@ import (
"strings"
"time"
"gopkg.in/yaml.v3"
"github.com/gobwas/ws"
"github.com/gobwas/ws/wsutil"
"github.com/shirou/gopsutil/v4/cpu"
@@ -407,9 +408,11 @@ func (s *Server) Start() (err error) {
if grpcServer != nil {
s.AddTask(grpcServer, s.Logger)
}
s.Streams.OnStart(func() {
s.Streams.AddTask(&CheckSubWaitTimeout{s: s})
})
if s.PulseInterval > 0 {
s.Streams.OnStart(func() {
s.Streams.AddTask(&CheckSubWaitTimeout{s: s})
})
}
s.loadAdminZip()
// s.Transforms.AddTask(&TransformsPublishEvent{Transforms: &s.Transforms})
s.Info("server started")