(ctx context.Context, projectName string, options api.PauseOptions)
| 33 | } |
| 34 | |
| 35 | func (s *composeService) pause(ctx context.Context, projectName string, options api.PauseOptions) error { |
| 36 | containers, err := s.getContainers(ctx, projectName, oneOffExclude, false, options.Services...) |
| 37 | if err != nil { |
| 38 | return err |
| 39 | } |
| 40 | |
| 41 | if options.Project != nil { |
| 42 | containers = containers.filter(isService(options.Project.ServiceNames()...)) |
| 43 | } |
| 44 | |
| 45 | return forEachContainerConcurrent(ctx, containers, func(ctx context.Context, ctr container.Summary) error { |
| 46 | _, err := s.apiClient().ContainerPause(ctx, ctr.ID, client.ContainerPauseOptions{}) |
| 47 | if err == nil { |
| 48 | s.events.On(newEvent(getContainerProgressName(ctr), api.Done, "Paused")) |
| 49 | } |
| 50 | return err |
| 51 | }) |
| 52 | } |
| 53 | |
| 54 | func (s *composeService) UnPause(ctx context.Context, projectName string, options api.PauseOptions) error { |
| 55 | return Run(ctx, func(ctx context.Context) error { |
no test coverage detected