diff --git a/config.go b/config.go index aa8965e8..b573e398 100644 --- a/config.go +++ b/config.go @@ -141,8 +141,8 @@ func (c *Config) SetDisplayRotation(rotation string) error { const configPath = "/userdata/kvm_config.json" -// it's a temporary solution to avoid sharing the same pointer -// we should migrate to a proper config solution in the future +// Default configuration structs used to create independent copies in getDefaultConfig(). +// These are package-level variables to avoid repeated allocations. var ( defaultJigglerConfig = JigglerConfig{ InactivityLimitSeconds: 60, diff --git a/jsonrpc.go b/jsonrpc.go index f9bf06fe..4bb65fff 100644 --- a/jsonrpc.go +++ b/jsonrpc.go @@ -499,7 +499,7 @@ type RPCHandler struct { Params []string } -// call the handler but recover from a panic to ensure our RPC thread doesn't collapse on malformed calls +// call the handler but recover from a panic to ensure our RPC goroutine doesn't collapse on malformed calls func callRPCHandler(logger zerolog.Logger, handler RPCHandler, params map[string]any) (result any, err error) { // Use defer to recover from a panic defer func() {