Skip to content

Commit

Permalink
Merge branch 'master' into apibyogclone
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielMieg authored Jun 25, 2024
2 parents 567294f + b9022dc commit a6f25ea
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
4 changes: 2 additions & 2 deletions cmd/abapAddonAssemblyKitPublishTargetVector_generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 8 additions & 2 deletions pkg/abap/aakaas/targetVector.go
Original file line number Diff line number Diff line change
Expand Up @@ -155,12 +155,17 @@ func (tv *TargetVector) GetTargetVector(conn *abapbuild.Connector) error {

// PollForStatus : Poll AAKaaS until final PublishStatus reached and check if desired Status was reached
func (tv *TargetVector) PollForStatus(conn *abapbuild.Connector, targetStatus TargetVectorStatus) error {
var cachedError error
timeout := time.After(conn.MaxRuntime)
ticker := time.Tick(conn.PollingInterval)
for {
select {
case <-timeout:
return errors.New("Timed out (AAKaaS target Vector Status change)")
if cachedError == nil {
return errors.New("Timed out (AAKaaS target Vector Status change)")
} else {
return cachedError
}
case <-ticker:
if err := tv.GetTargetVector(conn); err != nil {
return errors.Wrap(err, "Getting TargetVector status during polling resulted in an error")
Expand All @@ -172,7 +177,8 @@ func (tv *TargetVector) PollForStatus(conn *abapbuild.Connector, targetStatus Ta
if TargetVectorStatus(tv.Status) == targetStatus {
return nil
} else {
return errors.New("Publishing of Targetvector " + tv.ID + " resulted in state " + string(tv.Status) + " instead of expected state " + string(targetStatus))
cachedError = errors.New("Publishing of Targetvector " + tv.ID + " resulted in state " + string(tv.Status) + " instead of expected state " + string(targetStatus))
continue
}
case TargetVectorPublishStatusError:
return errors.New("Publishing of Targetvector " + tv.ID + " failed in AAKaaS")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ spec:
- STAGES
- STEPS
- GENERAL
default: 16
default: 90
- name: pollingIntervalInSeconds
type: int
description: Wait time in seconds between polling calls
Expand Down

0 comments on commit a6f25ea

Please sign in to comment.