MCPcopy
hub / github.com/cloudfoundry/cli / refreshTokenPeriodically

Method refreshTokenPeriodically

command/v7/logs_command.go:96–120  ·  view source on GitHub ↗
(
	stop chan struct{},
	stoppedRefreshing chan struct{},
	stoppedOutputtingRefreshErrors chan struct{})

Source from the content-addressed store, hash-verified

94}
95
96func (cmd LogsCommand) refreshTokenPeriodically(
97 stop chan struct{},
98 stoppedRefreshing chan struct{},
99 stoppedOutputtingRefreshErrors chan struct{}) error {
100
101 tokenRefreshErrors, err := cmd.Actor.ScheduleTokenRefresh(time.After, stop, stoppedRefreshing)
102 if err != nil {
103 return err
104 }
105
106 go func() {
107 defer close(stoppedOutputtingRefreshErrors)
108
109 for {
110 select {
111 case err := <-tokenRefreshErrors:
112 cmd.UI.DisplayError(err)
113 case <-stop:
114 return
115 }
116 }
117 }()
118
119 return nil
120}
121
122func (cmd LogsCommand) handleLogErr(logErr error) {
123 switch logErr.(type) {

Callers 1

ExecuteMethod · 0.95

Calls 2

ScheduleTokenRefreshMethod · 0.65
DisplayErrorMethod · 0.65

Tested by

no test coverage detected