MCPcopy Create free account
hub / github.com/TheThingsNetwork/lorawan-stack / SaveData

Method SaveData

pkg/telemetry/exporter/cli/task.go:133–146  ·  view source on GitHub ↗

SaveData process and stores data related to the CLI usage.

(ctx context.Context, cmd *cobra.Command)

Source from the content-addressed store, hash-verified

131
132// SaveData process and stores data related to the CLI usage.
133func (*cliTask) SaveData(ctx context.Context, cmd *cobra.Command) {
134 logger := log.FromContext(ctx)
135
136 st, err := store.New()
137 if err != nil {
138 logger.WithError(err).Debug("Failed to open telemetry database")
139 return
140 }
141
142 if err := st.StoreCommand(cmd); err != nil {
143 logger.WithError(err).Debug("Failed to store command usage data")
144 return
145 }
146}

Callers

nothing calls this directly

Calls 5

FromContextFunction · 0.92
NewFunction · 0.92
DebugMethod · 0.65
WithErrorMethod · 0.65
StoreCommandMethod · 0.65

Tested by

no test coverage detected