Skip to content

Commit

Permalink
fix dont ping private deployments
Browse files Browse the repository at this point in the history
  • Loading branch information
saffronjam committed Nov 9, 2023
1 parent 03642e3 commit 8b7ab55
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions pkg/workers/ping/workers.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,7 @@ func deploymentPingUpdater(ctx context.Context) {

func pingDeployment(deployment *deploymentModels.Deployment) {
makeError := func(err error) error {
return fmt.Errorf("failed to ping deployments. details: %w", err)
}

baseURL := deployment.GetURL()
if baseURL == nil {
utils.PrettyPrintError(makeError(fmt.Errorf("deployment %s has no url", deployment.Name)))
return
return fmt.Errorf("failed to ping deployment. details: %w", err)
}

mainApp := deployment.GetMainApp()
Expand All @@ -55,6 +49,16 @@ func pingDeployment(deployment *deploymentModels.Deployment) {
return
}

if mainApp.Private {
return
}

baseURL := deployment.GetURL()
if baseURL == nil {
utils.PrettyPrintError(makeError(fmt.Errorf("deployment %s has no url", deployment.Name)))
return
}

subPath := mainApp.PingPath
if len(mainApp.PingPath) > 0 && !strings.HasPrefix(mainApp.PingPath, "/") {
subPath = "/" + subPath
Expand Down

0 comments on commit 8b7ab55

Please sign in to comment.