summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--internal/clients/baseclient.go9
-rw-r--r--internal/io/fs/readfile.go1
2 files changed, 9 insertions, 1 deletions
diff --git a/internal/clients/baseclient.go b/internal/clients/baseclient.go
index 41521ea..3cd85fe 100644
--- a/internal/clients/baseclient.go
+++ b/internal/clients/baseclient.go
@@ -112,10 +112,19 @@ func (c *baseClient) startConnection(ctx context.Context, i int,
// Retrieve status code from handler (dtail client will exit with that status)
status = conn.Handler().Status()
+ // Do we want to retry?
if !c.retry {
+ // No, we don't.
return
}
+ select {
+ case <-ctx.Done():
+ // No, context is done, so no retry.
+ return
+ default:
+ }
+ // Yes, we want to retry.
time.Sleep(time.Second * 2)
dlog.Client.Debug(conn.Server(), "Reconnecting")
conn = c.makeConnection(conn.Server(), c.sshAuthMethods, c.hostKeyCallback)
diff --git a/internal/io/fs/readfile.go b/internal/io/fs/readfile.go
index 5815aa3..a42fc53 100644
--- a/internal/io/fs/readfile.go
+++ b/internal/io/fs/readfile.go
@@ -233,7 +233,6 @@ func (f readFile) filterWithoutLContext(ctx context.Context, rawLines <-chan *by
return
}
if filteredLine, ok := f.transmittable(line, len(lines), cap(lines), re); ok {
- //dlog.Common.Trace("TODO", "lines", lines, len(lines), cap(lines))
select {
case lines <- filteredLine:
case <-ctx.Done():