Skip to content

Commit bdfdff6

Browse files
Add daemon to the user agent when the CLI is started in daemon mode
1 parent 84fc413 commit bdfdff6

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

internal/cli/daemon/daemon.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,17 @@ func NewCommand(srv rpc.ArduinoCoreServiceServer, settings *rpc.Configuration) *
6666
if maxGRPCRecvMsgSize < 1024 {
6767
feedback.Fatal(i18n.Tr("%s must be >= 1024", "--max-grpc-recv-message-size"), feedback.ErrBadArgument)
6868
}
69+
70+
// The user agent should include "daemon" for analytics purposes
71+
_, err := srv.SettingsSetValue(cmd.Context(), &rpc.SettingsSetValueRequest{
72+
Key: "network.user_agent_ext",
73+
ValueFormat: "cli",
74+
EncodedValue: "daemon",
75+
})
76+
if err != nil {
77+
// Should never happen...
78+
panic("Failed to set default value for network.user_agent_ext: " + err.Error())
79+
}
6980
},
7081
Run: func(cmd *cobra.Command, args []string) {
7182
runDaemonCommand(srv, daemonPort, debugFile, debug, daemonize, debugFiltersArg, maxGRPCRecvMsgSize)

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy