From 3adb1c74a8e0b84fbe847400607b32368fc592fc Mon Sep 17 00:00:00 2001 From: Bryce Covert Date: Mon, 11 Jul 2022 09:40:52 -0700 Subject: [PATCH] trying to be better with square integration. --- src/clj/auto_ap/square/core.clj | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/clj/auto_ap/square/core.clj b/src/clj/auto_ap/square/core.clj index 36f8f20c..80b0eabd 100644 --- a/src/clj/auto_ap/square/core.clj +++ b/src/clj/auto_ap/square/core.clj @@ -318,11 +318,12 @@ (->> lookup-dates (mapcat (fn [[start-date end-date]] (log/info "looking up settlements for " (:square-location/client-location location) " on dates " start-date " to " end-date) - (let [settlements (->> (client/get (str "https://connect.squareup.com/v1/" (:square-location/square-id location) "/settlements") - {:headers (client-base-headers client) - :query-params {"begin_time" start-date - "end_time" end-date} - :as :json}) + (let [settlements (->> (retry #(client/get (str "https://connect.squareup.com/v1/" (:square-location/square-id location) "/settlements") + {:headers (client-base-headers client) + :query-params {"begin_time" start-date + "end_time" end-date} + :as :json + :retry-handler retry-4})) :body (map :id))] settlements)))