Last active
April 7, 2025 12:56
-
-
Save potetm/a808487a76aa92cf317920972e4cac25 to your computer and use it in GitHub Desktop.
fusebox example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (def retry-config | |
| (retry/init {::retry/retry? (fn [n ms ex] | |
| (and (<= n 10) | |
| (<= ms 1000))) | |
| ::retry/delay (constantly 500)})) | |
| (retry/with-retry retry-config | |
| (get-instruments-info false | |
| init/http-client | |
| {:category "spot"} | |
| {:pairs-count-on-dev 10})) | |
| ;; or this is more true to the original task | |
| (def retry-config | |
| (retry/init {::retry/retry? (fn [n ms ex] | |
| (and (<= n 10) | |
| (<= ms 1000))) | |
| ::retry/delay (constantly 500)})) | |
| (defn with-retry [config f & args] | |
| (retry/with-retry config | |
| (apply f args))) | |
| (with-retry retry-config | |
| get-instruments-info | |
| false | |
| init/http-client | |
| {:category "spot"} | |
| {:pairs-count-on-dev 10}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment