AppRunner: Include commit hash in the ping request
Increase ping frequencey to twice a second.
Change-Id: I43a064d17a22525e276140c689bea23df6c31655
diff --git a/apps/app-runner/server.go b/apps/app-runner/server.go
index 7c74575..1f44481 100644
--- a/apps/app-runner/server.go
+++ b/apps/app-runner/server.go
@@ -172,6 +172,11 @@
Commands: []CommandStatus{},
}
}
+ if s.status.Commit != nil {
+ s.logs.commitHash = s.status.Commit.Hash
+ } else {
+ s.logs.commitHash = ""
+ }
if s.agentMode && s.repoAddr == "" {
if _, err := os.Stat(filepath.Join(newDir, ".git")); err != nil && os.IsNotExist(err) {
commands = append(commands, command{cmd: "git config --global user.name dodo"})
@@ -281,7 +286,7 @@
func (s *Server) pingManager() {
defer func() {
go func() {
- time.Sleep(5 * time.Second)
+ time.Sleep(500 * time.Millisecond)
s.pingManager()
}()
}()