(
stop chan struct{},
stoppedRefreshing chan struct{},
stoppedOutputtingRefreshErrors chan struct{})
| 94 | } |
| 95 | |
| 96 | func (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 | |
| 122 | func (cmd LogsCommand) handleLogErr(logErr error) { |
| 123 | switch logErr.(type) { |
no test coverage detected