Delete relay json along with queue entry

This commit is contained in:
Devon Hudson 2022-12-15 10:41:06 -07:00
parent ad53326ce8
commit ab57b30883
No known key found for this signature in database
GPG key ID: CD06B18E77F6A628

View file

@ -88,6 +88,7 @@ func (d *Database) CleanAsyncTransactions(
for i, receipt := range receipts {
nids[i] = receipt.GetNID()
}
err := d.Writer.Do(d.DB, nil, func(txn *sql.Tx) error {
err := d.RelayQueue.DeleteQueueEntries(ctx, txn, userID.Domain(), nids)
return err
@ -96,6 +97,14 @@ func (d *Database) CleanAsyncTransactions(
return fmt.Errorf("d.deleteQueueEntries: %w", err)
}
err = d.Writer.Do(d.DB, nil, func(txn *sql.Tx) error {
err := d.RelayQueueJSON.DeleteQueueJSON(ctx, txn, nids)
return err
})
if err != nil {
return fmt.Errorf("d.deleteQueueJSON: %w", err)
}
return nil
}