(shutdownContext context.Context)
| 156 | } |
| 157 | |
| 158 | func (p *pool) triggerStop(shutdownContext context.Context) { |
| 159 | p.mutex.Lock() |
| 160 | if p.stopping { |
| 161 | p.mutex.Unlock() |
| 162 | return |
| 163 | } |
| 164 | p.stopping = true |
| 165 | svc := p.services |
| 166 | p.mutex.Unlock() |
| 167 | |
| 168 | wg := &sync.WaitGroup{} |
| 169 | wg.Add(len(svc)) |
| 170 | for _, s := range svc { |
| 171 | service := s |
| 172 | l := p.lifecycles[service] |
| 173 | go func() { |
| 174 | defer wg.Done() |
| 175 | l.Stop(shutdownContext) |
| 176 | }() |
| 177 | } |
| 178 | wg.Wait() |
| 179 | } |
no test coverage detected