Skip to content

Commit c4c3672

Browse files
committed
Reorganize code to reduce loop arguments
No change in behavior.
1 parent d474926 commit c4c3672

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

src/salmon/cloudformation.clj

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -299,16 +299,15 @@
299299
schema (-> system ::ds/component-def :schema)]
300300
(if client
301301
instance
302-
(do
303-
(validate! signal schema template)
304-
(loop [client (or (:client config)
305-
(aws/client {:api :cloudformation :region region}))
306-
[r updated?] (cou-stack! client signal (:json (template-data :template template :validate? false)))]
302+
(let [_ (validate! signal schema template)
303+
client (or (:client config)
304+
(aws/client {:api :cloudformation :region region}))]
305+
(loop [[r updated?] (cou-stack! client signal (:json (template-data :template template :validate? false)))]
307306
(cond
308307
(some-> r u/aws-error-message in-progress-error-message?)
309308
(do
310309
(wait-until-complete! name client)
311-
(recur client (cou-stack! client signal (:json (template-data :template template :validate? false)))))
310+
(recur (cou-stack! client signal (:json (template-data :template template :validate? false)))))
312311

313312
(u/anomaly? r)
314313
(throw (response-error "Error creating stack" r))

0 commit comments

Comments
 (0)