diff options
| author | Paul Buetow <git@mx.buetow.org> | 2020-12-26 10:48:51 +0000 |
|---|---|---|
| committer | Paul Buetow <git@mx.buetow.org> | 2020-12-26 10:48:51 +0000 |
| commit | ab676c2b484225ed22765b23d8f0545088ecd610 (patch) | |
| tree | 5292e21339fef551f19e8fdd90beeb35d676381d /internal/clients/handlers | |
| parent | b4db37d8cbae8f0c3dec289b2e1b0cfe83731415 (diff) | |
code cleanup and minor refactorings
Diffstat (limited to 'internal/clients/handlers')
| -rw-r--r-- | internal/clients/handlers/basehandler.go | 18 | ||||
| -rw-r--r-- | internal/clients/handlers/healthhandler.go | 1 |
2 files changed, 2 insertions, 17 deletions
diff --git a/internal/clients/handlers/basehandler.go b/internal/clients/handlers/basehandler.go index b5045e2..f07fd90 100644 --- a/internal/clients/handlers/basehandler.go +++ b/internal/clients/handlers/basehandler.go @@ -4,7 +4,6 @@ import ( "encoding/base64" "fmt" "io" - "strconv" "strings" "time" @@ -78,6 +77,7 @@ func (h *baseHandler) Read(p []byte) (n int, err error) { case <-h.Done(): return 0, io.EOF } + return } @@ -111,21 +111,5 @@ func (h *baseHandler) handleHiddenMessage(message string) { case <-h.Done(): return } - - case strings.HasPrefix(message, ".run exitstatus"): - splitted := strings.Split(strings.TrimSuffix(message, "\n"), " ") - if len(splitted) != 3 { - logger.Error("Unable to retrieve exitstatus", message) - return - } - i, err := strconv.Atoi(splitted[2]) - if err != nil { - logger.Error("Unable to retrieve exitstatus", message, err) - return - } - logger.Debug("Retrieved exitstatus", h.status) - if i > h.status { - h.status = i - } } } diff --git a/internal/clients/handlers/healthhandler.go b/internal/clients/handlers/healthhandler.go index 08ed137..0440706 100644 --- a/internal/clients/handlers/healthhandler.go +++ b/internal/clients/handlers/healthhandler.go @@ -19,6 +19,7 @@ type HealthHandler struct { receive chan<- string // The remote server address server string + // The return status. status int } |
