Skip to content

Commit

Permalink
resolve RateLimitExceeded (#518)
Browse files Browse the repository at this point in the history
Co-authored-by: Sam Leung <sam.leung@sap.com>
  • Loading branch information
sleungcy and sleungcy-sap committed Aug 14, 2023
1 parent f7ceb3a commit 217682b
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -124,10 +124,11 @@ func (s BlueGreen) Deploy(appDeploy AppDeploy) (AppDeployResponse, error) {
channelIsStopped := make(chan bool, 1)
channelError := make(chan error, 1)
var err error
var timedout = false

go func() {
isStopped := false
for !isStopped {
for !isStopped && !timedout {
isStopped, err = isAppStopped(s.client, appDeploy.App.GUID)
time.Sleep(delayBetweenRequests * time.Second)
}
Expand All @@ -140,6 +141,7 @@ func (s BlueGreen) Deploy(appDeploy AppDeploy) (AppDeployResponse, error) {
case <-time.After(stopAppTimeout * time.Second):
// App is not in expected state (stopped) after waiting for the timeout
log.Print("Timeout reached while waiting for application to stop.")
timedout = true
case <-channelError:
return ctx, err
}
Expand Down

0 comments on commit 217682b

Please sign in to comment.