mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
Merge pull request #12226 from jingyih/fix_backport_PR12216
*: add plog logging to the backport of PR12216
This commit is contained in:
@@ -48,7 +48,7 @@ type watchServer struct {
|
||||
|
||||
// NewWatchServer returns a new watch server.
|
||||
func NewWatchServer(s *etcdserver.EtcdServer) pb.WatchServer {
|
||||
return &watchServer{
|
||||
srv := &watchServer{
|
||||
lg: s.Cfg.Logger,
|
||||
|
||||
clusterID: int64(s.Cluster().ID()),
|
||||
@@ -60,15 +60,16 @@ func NewWatchServer(s *etcdserver.EtcdServer) pb.WatchServer {
|
||||
watchable: s.Watchable(),
|
||||
ag: s,
|
||||
}
|
||||
if srv.lg == nil {
|
||||
srv.lg = zap.NewNop()
|
||||
}
|
||||
if s.Cfg.WatchProgressNotifyInterval > 0 {
|
||||
if s.Cfg.WatchProgressNotifyInterval < minWatchProgressInterval {
|
||||
srv.lg.Warn(
|
||||
"adjusting watch progress notify interval to minimum period",
|
||||
zap.Duration("min-watch-progress-notify-interval", minWatchProgressInterval),
|
||||
)
|
||||
if srv.lg != nil {
|
||||
srv.lg.Warn(
|
||||
"adjusting watch progress notify interval to minimum period",
|
||||
zap.Duration("min-watch-progress-notify-interval", minWatchProgressInterval),
|
||||
)
|
||||
} else {
|
||||
plog.Warningf("adjusting watch progress notify interval to minimum period %v", minWatchProgressInterval)
|
||||
}
|
||||
s.Cfg.WatchProgressNotifyInterval = minWatchProgressInterval
|
||||
}
|
||||
SetProgressReportInterval(s.Cfg.WatchProgressNotifyInterval)
|
||||
|
||||
Reference in New Issue
Block a user