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)
|
||||
let payment = val payTx
|
||||
case payment of
|
||||
Doc d ->
|
||||
access pipe master dbName $
|
||||
upsert (select ["txid" =: txid p] "payments") 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 ()
|
||||
|
||||
authSettings :: AuthSettings
|
||||
|
|
Loading…
Reference in a new issue