progress: Stop event on error

Ensures that we set an `endTime` when an error event is published.

Signed-off-by: Christopher Crone <christopher.crone@docker.com>
This commit is contained in:
Christopher Crone 2020-07-06 13:26:34 +02:00
parent 8ad53088a3
commit 9cc04472fb
1 changed files with 5 additions and 2 deletions

View File

@ -68,8 +68,11 @@ func (w *ttyWriter) Event(e Event) {
}
if _, ok := w.events[e.ID]; ok {
event := w.events[e.ID]
if event.Status != Done && e.Status == Done {
event.stop()
switch e.Status {
case Done, Error:
if event.Status != e.Status {
event.stop()
}
}
event.Status = e.Status
event.Text = e.Text