mirror of
https://github.com/docker/compose.git
synced 2025-07-21 12:44:54 +02:00
Merge pull request #8726 from ndeloof/log_follow_killed
`log --follow` must stop when container get killed
This commit is contained in:
commit
0062703bea
@ -35,12 +35,16 @@ func (s *composeService) Logs(ctx context.Context, projectName string, consumer
|
||||
|
||||
eg, ctx := errgroup.WithContext(ctx)
|
||||
if options.Follow {
|
||||
printer := newLogPrinter(consumer)
|
||||
eg.Go(func() error {
|
||||
printer := newLogPrinter(consumer)
|
||||
return s.watchContainers(ctx, projectName, options.Services, printer.HandleEvent, containers, func(c types.Container) error {
|
||||
return s.logContainers(ctx, consumer, c, options)
|
||||
})
|
||||
})
|
||||
eg.Go(func() error {
|
||||
_, err := printer.Run(false, "", nil)
|
||||
return err
|
||||
})
|
||||
}
|
||||
|
||||
for _, c := range containers {
|
||||
|
Loading…
x
Reference in New Issue
Block a user