Method
sleepWithCancel
(sleepTime time.Duration)
Source from the content-addressed store, hash-verified
| 147 | } |
| 148 | |
| 149 | func (t *toolsUpdater) sleepWithCancel(sleepTime time.Duration) (canceled bool) { |
| 150 | if sleepTime == 0 { |
| 151 | return false |
| 152 | } |
| 153 | ticker := time.NewTicker(sleepTime) |
| 154 | defer ticker.Stop() |
| 155 | |
| 156 | select { |
| 157 | case <-ticker.C: |
| 158 | return false |
| 159 | case <-t.quit: |
| 160 | case <-t.ctx.Done(): |
| 161 | } |
| 162 | return true |
| 163 | } |
| 164 | |
| 165 | // giteaUpdateLoop updates tools for gitea. The act runner can be downloaded |
| 166 | // without a token, unlike the github tools, which for GHES require a token. |
Tested by
no test coverage detected