MCPcopy Create free account
hub / github.com/Thunder-Compute/thunder-cli / kickoffSubscriptionCheck

Function kickoffSubscriptionCheck

cmd/root.go:486–496  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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.
486func 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
498func showCachedSubscriptionWarning(cmd *cobra.Command) {
499 if shouldSkipSubscriptionCheck(cmd) {

Callers 1

initFunction · 0.85

Calls 4

NewClientFunction · 0.92
RefreshFunction · 0.92
LoadConfigFunction · 0.85

Tested by

no test coverage detected