mrproliu commented on code in PR #928:
URL: 
https://github.com/apache/skywalking-banyandb/pull/928#discussion_r2671467919


##########
banyand/metadata/client.go:
##########
@@ -230,8 +252,23 @@ func (s *clientService) PreRun(ctx context.Context) error {
                }
        }
 
-       // skip node registration if DNS mode is enabled or node registration 
is disabled
-       if !s.toRegisterNode || s.nodeDiscoveryMode == NodeDiscoveryModeDNS {
+       if s.nodeDiscoveryMode == NodeDiscoveryModeFile {
+               l.Info().Str("file-path", s.filePath).Msg("Initializing 
file-based node discovery")
+
+               var createErr error
+               s.fileDiscovery, createErr = file.NewService(file.Config{
+                       FilePath:      s.filePath,
+                       GRPCTimeout:   s.grpcTimeout,
+                       FetchInterval: s.fileFetchInterval,
+               })
+               if createErr != nil {
+                       return fmt.Errorf("failed to create file discovery 
service: %w", createErr)
+               }
+       }
+
+       // skip node registration if DNS/file mode is enabled or node 
registration is disabled
+       if !s.toRegisterNode || s.nodeDiscoveryMode == NodeDiscoveryModeDNS ||
+               s.nodeDiscoveryMode == NodeDiscoveryModeFile {

Review Comment:
   Wrong comment, for now, the judgment is correct. If there is no need to 
register a node, or if it is DNS discovery, or if it is file discovery, the 
register would be ignored. 



-- 
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