invoices: more verbose logging for startup invoice GC

This commit is contained in:
Andras Banki-Horvath 2021-04-22 15:31:17 +02:00
parent adbcc3f7a3
commit ec50f2ccce
No known key found for this signature in database
GPG Key ID: 80E5375C094198D8

@ -213,8 +213,15 @@ func (i *InvoiceRegistry) scanInvoicesOnStart() error {
len(pending))
i.expiryWatcher.AddInvoices(pending...)
if err := i.cdb.DeleteInvoice(removable); err != nil {
log.Warnf("Deleting old invoices failed: %v", err)
if len(removable) > 0 {
log.Infof("Attempting to delete %v canceled invoices",
len(removable))
if err := i.cdb.DeleteInvoice(removable); err != nil {
log.Warnf("Deleting canceled invoices failed: %v", err)
} else {
log.Infof("Deleted %v canceled invoices",
len(removable))
}
}
return nil