hanahmily commented on code in PR #882:
URL: 
https://github.com/apache/skywalking-banyandb/pull/882#discussion_r2593120694


##########
banyand/queue/pub/pub.go:
##########
@@ -126,6 +134,32 @@ func (p *pub) GracefulStop() {
 
 // Serve implements run.Service.
 func (p *pub) Serve() run.StopNotify {
+       // Start CA certificate reloader if enabled
+       if p.caCertReloader != nil {
+               if err := p.caCertReloader.Start(); err != nil {
+                       p.log.Error().Err(err).Msg("Failed to start CA 
certificate reloader")
+                       stopCh := p.closer.CloseNotify()
+                       return stopCh
+               }
+               p.log.Info().Str("caCertPath", p.caCertPath).Msg("Started CA 
certificate file monitoring")
+
+               // Listen for certificate update events
+               certUpdateCh := p.caCertReloader.GetUpdateChannel()
+               stopCh := p.closer.CloseNotify()
+               go func() {
+                       for {
+                               select {
+                               case <-certUpdateCh:
+                                       p.log.Info().Msg("CA certificate 
updated, reconnecting clients")
+                                       p.reconnectAllClients()
+                               case <-stopCh:
+                                       return
+                               }
+                       }
+               }()

Review Comment:
   @OmCheeLin it's relevant. fix this issue.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to