Skip to content

Commit

Permalink
Wait for new token-details to complete inserting
Browse files Browse the repository at this point in the history
  • Loading branch information
madis committed Jan 7, 2025
1 parent 70c83f4 commit c517d3b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions server/src/ethlance/server/syncer/handlers.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@
:decimals 18}]
(when (not (<? (ethlance-db/get-token conn token-address)))
(if (= :eth token-type)
(ethlance-db/store-token-details conn eth-token-details)
(ethlance-db/store-token-details conn (<! (token-utils/get-token-details token-type token-address))))))))
(<! (ethlance-db/store-token-details conn eth-token-details))
(<! (ethlance-db/store-token-details conn (<! (token-utils/get-token-details token-type token-address)))))))))

(defn handle-job-created
[conn _ {:keys [args] :as event}]
Expand Down Expand Up @@ -291,7 +291,7 @@
{:job-funding/amount (movement-sign-fn (:token-amount tv))
:token-detail/id (:token-address tv)}))
funds-map)]
(doseq [[token-type token-address] tokens-info] (ensure-db-token-details token-type token-address conn))
(doseq [[token-type token-address] tokens-info] (<! (ensure-db-token-details token-type token-address conn)))
(doseq [funding funding-updates]
(<? (ethlance-db/insert-row! conn :JobFunding funding :ignore-conflict-on [:tx]))))))

Expand Down

0 comments on commit c517d3b

Please sign in to comment.