Skip to content

Commit 51d6f8b

Browse files
committed
chore: simplify print
1 parent 8c9fbd3 commit 51d6f8b

File tree

1 file changed

+3
-20
lines changed

1 file changed

+3
-20
lines changed

docker.go

Lines changed: 3 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -636,14 +636,7 @@ func (c *DockerContainer) StartLogProducer(ctx context.Context) error {
636636
return
637637
}
638638

639-
// we need a separate select here in order to be able to print the error
640-
// and this cannot be done in the same select that checks for the timeout.
641-
select {
642-
case <-ctx.Done():
643-
return
644-
default:
645-
c.logger.Printf("cannot get logs for container %q: %v", c.ID, err)
646-
}
639+
c.logger.Printf("cannot get logs for container %q: %v", c.ID, err)
647640

648641
select {
649642
case <-ctx.Done():
@@ -678,12 +671,7 @@ func (c *DockerContainer) StartLogProducer(ctx context.Context) error {
678671
goto BEGIN
679672
}
680673

681-
select {
682-
case <-ctx.Done():
683-
return
684-
default:
685-
c.logger.Printf("read log header: %+v. %s", err, logRestartedForOutOfSyncMessage)
686-
}
674+
c.logger.Printf("read log header: %+v. %s", err, logRestartedForOutOfSyncMessage)
687675

688676
// if we would continue here, the next header-read will result into random data...
689677
// we need to restart the whole request.
@@ -729,12 +717,7 @@ func (c *DockerContainer) StartLogProducer(ctx context.Context) error {
729717
// if we would continue here, the next header-read will result into random data...
730718
// we need to restart the whole request.
731719

732-
select {
733-
case <-ctx.Done():
734-
return
735-
default:
736-
c.logger.Printf("read log message: %+v. %s", err, logRestartedForOutOfSyncMessage)
737-
}
720+
c.logger.Printf("read log message: %+v. %s", err, logRestartedForOutOfSyncMessage)
738721

739722
select {
740723
case <-ctx.Done():

0 commit comments

Comments
 (0)