Skip to content

Commit

Permalink
Handle health
Browse files Browse the repository at this point in the history
  • Loading branch information
piyushroshan committed May 29, 2024
1 parent 88ae9d2 commit 2ed99c7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
4 changes: 4 additions & 0 deletions services/community/api/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,11 @@ func identityServiceHealthCheck() {
}
var attempts = 0
for (attempts <= 5) {
tlsEnabled := os.Getenv("TLS_ENABLED")
identityHealthCheckUrl := fmt.Sprintf("http://%s/identity/health_check", os.Getenv("IDENTITY_SERVICE"))
if tlsEnabled == "true" {
identityHealthCheckUrl = fmt.Sprintf("https://%s/identity/health_check", os.Getenv("IDENTITY_SERVICE"))
}
resp, err := http.Get(identityHealthCheckUrl)
if err != nil {
log.Printf("Error while checking the health of identity service: %v", err)
Expand Down
3 changes: 3 additions & 0 deletions services/workshop/crapi_site/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -251,3 +251,6 @@ def get_env_value(env_variable):
IDENTITY_LOGIN = "https://{}/identity/api/auth/login".format(
get_env_value("IDENTITY_SERVICE")
)
IDENTITY_HEALTH = "https://{}/identity/health_check".format(
get_env_value("IDENTITY_SERVICE")
)

0 comments on commit 2ed99c7

Please sign in to comment.