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,9 +523,16 @@ 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
|
||||||
access pipe master dbName $
|
results <-
|
||||||
upsert (select ["txid" =: txid p] "payments") d
|
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 ()
|
_ -> return ()
|
||||||
|
|
||||||
authSettings :: AuthSettings
|
authSettings :: AuthSettings
|
||||||
|
|
Loading…
Reference in a new issue