Improve load of payments into DB
This commit is contained in:
parent
c74b75d025
commit
f8b69a1c87
1 changed files with 10 additions and 3 deletions
|
@ -523,7 +523,14 @@ upsertPayment pipe dbName p = do
|
||||||
(memo p)
|
(memo p)
|
||||||
let payment = val payTx
|
let payment = val payTx
|
||||||
case payment of
|
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 $
|
access pipe master dbName $
|
||||||
upsert (select ["txid" =: txid p] "payments") d
|
upsert (select ["txid" =: txid p] "payments") d
|
||||||
_ -> return ()
|
_ -> return ()
|
||||||
|
|
Loading…
Reference in a new issue