Skip to content

Commit 386756a

Browse files
Update cli/daemon/daemon.go
Co-authored-by: Silvano Cerza <3314350+silvanocerza@users.noreply.github.com>
1 parent 0e0e52c commit 386756a

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

cli/daemon/daemon.go

+3-4
Original file line numberDiff line numberDiff line change
@@ -73,15 +73,14 @@ func runDaemonCommand(cmd *cobra.Command, args []string) {
7373
defer stats.Flush()
7474
}
7575
port := configuration.Settings.GetString("daemon.port")
76-
var s *grpc.Server
76+
gRPCOptions := []grpc.ServerOption{}
7777
if debug {
78-
s = grpc.NewServer(
78+
gRPCOptions = append(gRPCOptions,
7979
grpc.UnaryInterceptor(unaryLoggerInterceptor),
8080
grpc.StreamInterceptor(streamLoggerInterceptor),
8181
)
82-
} else {
83-
s = grpc.NewServer()
8482
}
83+
s := grpc.NewServer(gRPCOptions...)
8584
// Set specific user-agent for the daemon
8685
configuration.Settings.Set("network.user_agent_ext", "daemon")
8786

0 commit comments

Comments
 (0)