diff options
| author | Paul Buetow <paul@buetow.org> | 2021-08-28 20:26:32 +0100 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2021-08-28 20:28:34 +0100 |
| commit | 23982f331c2154a66b86d596226c24454fd06be5 (patch) | |
| tree | f8aa72eb5110a4de914f28a063b528fd166a3a6b /internal/clients | |
| parent | 8c2e94030d0e31289c35fcfb56499707fd4a7ccd (diff) | |
1. Major performance gain by not checking for file truncation aftter
each bytes read.
2. Introduce field separator to the protocol package.
Diffstat (limited to 'internal/clients')
| -rw-r--r-- | internal/clients/healthclient.go | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/internal/clients/healthclient.go b/internal/clients/healthclient.go index e93f6be..692464c 100644 --- a/internal/clients/healthclient.go +++ b/internal/clients/healthclient.go @@ -11,6 +11,7 @@ import ( "github.com/mimecast/dtail/internal/clients/remote" "github.com/mimecast/dtail/internal/config" "github.com/mimecast/dtail/internal/omode" + "github.com/mimecast/dtail/internal/protocol" gossh "golang.org/x/crypto/ssh" ) @@ -57,7 +58,7 @@ func (c *HealthClient) Start(ctx context.Context) (status int) { select { case data := <-receive: // Parse recieved data. - s := strings.Split(data, "|") + s := strings.Split(data, protocol.FieldDelimiter) message := s[len(s)-1] if strings.HasPrefix(message, "done;") { return |
