kickoffSubscriptionCheck launches a fire-and-forget refresh of the subscription-status cache so subsequent commands can surface a past_due warning. Never blocks the current command and silently no-ops when no auth is configured. Skipped under --json so scripted output stays clean.
(cmd *cobra.Command)
| 484 | // warning. Never blocks the current command and silently no-ops when no auth |
| 485 | // is configured. Skipped under --json so scripted output stays clean. |
| 486 | func kickoffSubscriptionCheck(cmd *cobra.Command) { |
| 487 | if shouldSkipSubscriptionCheck(cmd) { |
| 488 | return |
| 489 | } |
| 490 | cfg, err := LoadConfig() |
| 491 | if err != nil || cfg == nil || cfg.Token == "" { |
| 492 | return |
| 493 | } |
| 494 | client := api.NewClient(cfg.Token, cfg.APIURL) |
| 495 | go pastdue.Refresh(context.Background(), client) |
| 496 | } |
| 497 | |
| 498 | func showCachedSubscriptionWarning(cmd *cobra.Command) { |
| 499 | if shouldSkipSubscriptionCheck(cmd) { |
no test coverage detected