Skip to content
5 changes: 4 additions & 1 deletion cmd/project/project_upgrade_check.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"path"
"strconv"
"strings"
"time"

"charm.land/huh/v2"
"charm.land/lipgloss/v2"
Expand Down Expand Up @@ -164,7 +165,9 @@ var projectUpgradeCheckCmd = &cobra.Command{
break
}
}
go tracking.Track(cmd.Context(), "project.upgrade_check", map[string]string{
trackCtx, trackCancel := context.WithTimeout(context.WithoutCancel(cmd.Context()), 300*time.Millisecond)
defer trackCancel()
tracking.Track(trackCtx, "project.upgrade_check", map[string]string{
"from_version": shopwareVersion.String(),
"target_version": selectedVersion,
"has_blockers": strconv.FormatBool(hasBlockers),
Expand Down
4 changes: 3 additions & 1 deletion cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,9 @@ func Execute(ctx context.Context) {
name := strings.TrimPrefix(cmd.CommandPath(), "shopware-cli ")
name = strings.ReplaceAll(name, " ", ".")
name = strings.ReplaceAll(name, "-", "_")
go tracking.Track(ctx, "command", map[string]string{
trackCtx, trackCancel := context.WithTimeout(context.WithoutCancel(ctx), 300*time.Millisecond)
defer trackCancel()
tracking.Track(trackCtx, "command", map[string]string{
"command_name": name,
"result": result,
"duration_ms": strconv.FormatInt(time.Since(start).Milliseconds(), 10),
Expand Down