Complete records that a check has finished.
(name string)
| 46 | |
| 47 | // Complete records that a check has finished. |
| 48 | func (p *Progress) Complete(name string) { |
| 49 | p.mu.Lock() |
| 50 | defer p.mu.Unlock() |
| 51 | if p.Clock == nil { |
| 52 | p.Clock = quartz.NewReal() |
| 53 | } |
| 54 | if p.checks == nil { |
| 55 | p.checks = make(map[string]*checkStatus) |
| 56 | } |
| 57 | if p.checks[name] == nil { |
| 58 | p.checks[name] = &checkStatus{startedAt: p.Clock.Now()} |
| 59 | } |
| 60 | p.checks[name].completedAt = p.Clock.Now() |
| 61 | } |
| 62 | |
| 63 | // Reset clears all recorded check statuses. |
| 64 | func (p *Progress) Reset() { |