(e api.Resource)
| 203 | } |
| 204 | |
| 205 | func (w *ttyWriter) event(e api.Resource) { |
| 206 | // Suspend print while a build is in progress, to avoid collision with buildkit Display |
| 207 | if w.ticker != nil { |
| 208 | if e.Text == api.StatusBuilding { |
| 209 | w.ticker.Stop() |
| 210 | w.suspended = true |
| 211 | } else if w.suspended { |
| 212 | w.ticker.Reset(100 * time.Millisecond) |
| 213 | w.suspended = false |
| 214 | } |
| 215 | } |
| 216 | |
| 217 | if last, ok := w.tasks[e.ID]; ok { |
| 218 | last.update(e) |
| 219 | } else { |
| 220 | t := newTask(e) |
| 221 | w.tasks[e.ID] = &t |
| 222 | w.ids = append(w.ids, e.ID) |
| 223 | } |
| 224 | w.printEvent(e) |
| 225 | } |
| 226 | |
| 227 | func (w *ttyWriter) printEvent(e api.Resource) { |
| 228 | if w.operation != "" { |
no test coverage detected