Update USD value for an issue also when balance changes
* in addition to updating current USD value for open issues every 5 minutes, update for an issue if change in balance detected
This commit is contained in:
parent
8e3762c701
commit
b3b2d5eb5c
|
@ -218,14 +218,19 @@
|
|||
{:ETH eth-balance})]
|
||||
(merge all-funds {:total-usd (fiat-util/bounty-usd-value all-funds)})))
|
||||
|
||||
|
||||
(defn update-issue-usd-value
|
||||
[bounty-addr]
|
||||
(let [funds (get-bounty-funds bounty-addr)]
|
||||
(issues/update-usd-value bounty-addr
|
||||
(:total-usd funds))))
|
||||
|
||||
(defn update-open-issue-usd-values
|
||||
"Sum up current USD values of all crypto assets in a bounty and store to DB"
|
||||
[]
|
||||
(doseq [{bounty-addr :contract_address}
|
||||
(db-bounties/open-bounty-contracts)]
|
||||
(let [funds (get-bounty-funds bounty-addr)]
|
||||
(issues/update-usd-value bounty-addr
|
||||
(:total-usd funds)))))
|
||||
(update-issue-usd-value bounty-addr)))
|
||||
|
||||
(defn update-balances
|
||||
[]
|
||||
|
@ -265,7 +270,8 @@
|
|||
contract-address
|
||||
balance-eth
|
||||
balance-eth-str
|
||||
token-balances))))))
|
||||
token-balances)
|
||||
(update-issue-usd-value contract-address))))))
|
||||
|
||||
|
||||
(defn wrap-in-try-catch [func]
|
||||
|
|
Loading…
Reference in New Issue