Skip to content

Commit

Permalink
Add some more logging touches.
Browse files Browse the repository at this point in the history
  • Loading branch information
markusthoemmes committed Jan 16, 2019
1 parent a57bc76 commit 8f97764
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions cmd/queue/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -183,10 +183,18 @@ func handler(w http.ResponseWriter, r *http.Request) {
func createAdminHandlers() *http.ServeMux {
mux := http.NewServeMux()
mux.HandleFunc(queue.RequestQueueHealthPath, healthState.HealthHandler(func() bool {
return wait.PollImmediate(50*time.Millisecond, 10*time.Second, func() (bool, error) {
logger.Debug("TCP probing the user-container")
err := wait.PollImmediate(50*time.Millisecond, 10*time.Second, func() (bool, error) {
logger.Debug("TCP probing the user-container.")
return health.TCPProbe(userTargetAddress, 100*time.Millisecond), nil
}) == nil
})

if err == nil {
logger.Info("User-container successfully probed.")
} else {
logger.Error("User-container could not be probed successfully.")
}

return err == nil
}))

mux.HandleFunc(queue.RequestQueueQuitPath, healthState.QuitHandler(func() {
Expand Down

0 comments on commit 8f97764

Please sign in to comment.