Delete expired invoices after one pending check (#531)
* delete expired invoices regularly and after pending check * fix mistake * delete expired invoices only once
This commit is contained in:
parent
2c68f53c91
commit
2f62d98299
1 changed files with 3 additions and 2 deletions
|
|
@ -82,8 +82,6 @@ async def invoice_listener():
|
||||||
|
|
||||||
|
|
||||||
async def check_pending_payments():
|
async def check_pending_payments():
|
||||||
await delete_expired_invoices()
|
|
||||||
|
|
||||||
outgoing = True
|
outgoing = True
|
||||||
incoming = True
|
incoming = True
|
||||||
|
|
||||||
|
|
@ -98,6 +96,9 @@ async def check_pending_payments():
|
||||||
):
|
):
|
||||||
await payment.check_pending()
|
await payment.check_pending()
|
||||||
|
|
||||||
|
# we delete expired invoices once upon the first pending check
|
||||||
|
if incoming:
|
||||||
|
await delete_expired_invoices()
|
||||||
# after the first check we will only check outgoing, not incoming
|
# after the first check we will only check outgoing, not incoming
|
||||||
# that will be handled by the global invoice listeners, hopefully
|
# that will be handled by the global invoice listeners, hopefully
|
||||||
incoming = False
|
incoming = False
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue