fix issue with splitting to multiple wallets-queue

This commit is contained in:
Tiago vasconcelos 2022-10-06 15:21:09 +01:00 committed by dni ⚡
parent f7ca9d1c82
commit ba74d0ef7a

View File

@ -28,6 +28,10 @@ async def on_invoice_paid(payment: Payment) -> None:
# now we make some special internal transfers (from no one to the receiver)
targets = await get_targets(payment.wallet_id)
if not targets:
return
transfers = [
(target.wallet, int(target.percent * payment.amount / 100))
for target in targets
@ -41,9 +45,6 @@ async def on_invoice_paid(payment: Payment) -> None:
)
return
if not targets:
return
# mark the original payment with one extra key, "splitted"
# (this prevents us from doing this process again and it's informative)
# and reduce it by the amount we're going to send to the producer
@ -76,5 +77,5 @@ async def on_invoice_paid(payment: Payment) -> None:
)
# manually send this for now
await internal_invoice_queue.put(internal_checking_id)
await internal_invoice_queue.put(internal_checking_id)
return