Skip to content

Instantly share code, notes, and snippets.

@potetm
Last active April 7, 2025 12:56
Show Gist options
  • Select an option

  • Save potetm/a808487a76aa92cf317920972e4cac25 to your computer and use it in GitHub Desktop.

Select an option

Save potetm/a808487a76aa92cf317920972e4cac25 to your computer and use it in GitHub Desktop.
fusebox example
(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