Improve load of payments into DB

This commit is contained in:
Rene Vergara 2023-05-02 14:40:26 -05:00
parent c74b75d025
commit f8b69a1c87
Signed by: pitmutt
GPG key ID: 65122AD495A7F5B2

View file

@ -523,7 +523,14 @@ upsertPayment pipe dbName p = do
(memo p)
let payment = val payTx
case payment of
Doc d ->
Doc d -> do
results <-
access
pipe
master
dbName
(rest =<< find (select ["txid" =: txid p] "payments"))
when (null results) $
access pipe master dbName $
upsert (select ["txid" =: txid p] "payments") d
_ -> return ()