Skip to content

Commit

Permalink
Log the first start for a program when using --standalone
Browse files Browse the repository at this point in the history
  • Loading branch information
khrj committed Mar 17, 2021
1 parent 438b51d commit 78159e1
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 3 deletions.
1 change: 1 addition & 0 deletions daemon/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,4 @@ Examples:
// Errors
const sFailedToKillChildProcessError = "Failed to kill child process"
const sFailedToStartChildProcessError = "Failed to start child process"
const statProgramStart = "Program has been started."
1 change: 1 addition & 0 deletions daemon/daemon.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ func updateAndRestartProcess(isStandalone bool) error {
if isStandalone {
cmd = buildCmd(flag.Args(), true)
err := cmd.Start()
logger.Success(statProgramStart)

if err != nil {
logger.Error(sFailedToKillChildProcessError)
Expand Down
2 changes: 1 addition & 1 deletion daemon/server/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const sBodyParseError = "Failed to parse body"
const sMissingSignatureError = "Missing Signature"
const sUnexpectedHTTPServerCloseError = "Builtin HTTP server exited unexpectedly"

const statProgramStart = "Program has been started."
// Status
const statRequestRecieved = "Recieved restart request from application, processing..."
const statRequestValidationFailed = "Request validation failed, restart will not be triggered"
const statRequestValidationSuccess = "Request validation successful, restarting program"
2 changes: 0 additions & 2 deletions daemon/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,6 @@ func Listen(handler func() error) {

err = handler()

logger.Success(statProgramStart)

if err != nil {
fmt.Fprintf(w, "OK")
}
Expand Down

0 comments on commit 78159e1

Please sign in to comment.