Skip to content

Commit

Permalink
ci: fix release retry
Browse files Browse the repository at this point in the history
  • Loading branch information
TimoKramer committed Feb 20, 2023
1 parent 4f5b68b commit 9d336c8
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions build.clj
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,12 @@
(loop [idle-times (take retries (fib 1 2))]
(let [result (exec-fn)]
(if (test-fn result)
(when-let [sleep-ms (first idle-times)]
(println "Returned: " result)
(println "Retrying with remaining back-off times (in s): " idle-times)
(Thread/sleep (* 1000 sleep-ms))
(recur (rest idle-times)))
(do (println "Returned: " result)
(if-let [sleep-ms (first idle-times)]
(do (println "Retrying with remaining back-off times (in s): " idle-times)
(Thread/sleep (* 1000 sleep-ms))
(recur (rest idle-times)))
result))
result))))

(defn try-release []
Expand All @@ -63,9 +64,11 @@

(defn release
[_]
(-> (retry-with-fib-backoff 10 try-release :failure?)
:url
println))
(let [ret (retry-with-fib-backoff 10 try-release :failure?)]
(if (:failure? ret)
(do (println "GitHub release failed!")
(System/exit 1))
(println (:url ret)))))

(defn install
[_]
Expand Down

0 comments on commit 9d336c8

Please sign in to comment.