8000 GtAwsAutoScalingGroupManager>>waitForDescription use #isStale to wait… · feenkcom/gt4aws@04d8dc4 · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Commit 04d8dc4

Browse files
committed
GtAwsAutoScalingGroupManager>>waitForDescription use #isStale to wait for value.
1 parent 39a80b7 commit 04d8dc4

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

src/Gt4Aws/GtAwsAutoScalingGroupManager.class.st

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -96,13 +96,16 @@ GtAwsAutoScalingGroupManager >> waitForDescription [
9696
"Answer the receiver's description, waiting if it isn't yet available."
9797
| maxRetries retryCount delay description |
9898

99-
maxRetries := 9.
100-
delay := 1 second.
101-
retryCount := 0.
102-
[ description := self description.
103-
description isNil and: [ retryCount <= maxRetries ]. ] whileTrue:
104-
[ retryCount := retryCount + 1.
105-
delay wait. ].
99+
descriptionCache isStale ifTrue:
100+
[ maxRetries := 9.
101+
delay := 1 second.
102+
retryCount := 0.
103+
104+
descriptionCache keepAlive.
105+
[ descriptionCache isStale and: [ retryCount <= maxRetries ]. ] whileTrue:
106+
[ retryCount := retryCount + 1.
107+
delay wait. ] ].
108+
description := self description.
106109
description ifNil:
107110
[ self error: 'Unable to retrieve description' ].
108111
^ description

0 commit comments

Comments
 (0)
0