mirror of
https://github.com/moby/moby.git
synced 2026-01-11 18:51:37 +00:00
logfile: Close reader when caller cancels
This allows for an individual decode operation to be cancelled while the log reader is reading data from a log file by closing the underlying file. Signed-off-by: Brian Goff <cpuguy83@gmail.com>
This commit is contained in:
@@ -27,9 +27,7 @@ import (
|
||||
func (daemon *Daemon) ContainerLogs(ctx context.Context, containerName string, config *containertypes.LogsOptions) (messages <-chan *backend.LogMessage, isTTY bool, retErr error) {
|
||||
ctx, span := tracing.StartSpan(ctx, "daemon.ContainerLogs")
|
||||
defer func() {
|
||||
if retErr != nil {
|
||||
span.SetStatus(retErr)
|
||||
}
|
||||
span.SetStatus(retErr)
|
||||
span.End()
|
||||
}()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user