From af21ecd958fbeba26992746a62e36467575a2667 Mon Sep 17 00:00:00 2001 From: Daniel Lugo Date: Tue, 19 Oct 2021 15:49:56 -0400 Subject: [PATCH] Do not always trash orders --- services/gunDB/contact-api/jobs/onOrders.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/services/gunDB/contact-api/jobs/onOrders.js b/services/gunDB/contact-api/jobs/onOrders.js index b59a657b..d9e8634b 100644 --- a/services/gunDB/contact-api/jobs/onOrders.js +++ b/services/gunDB/contact-api/jobs/onOrders.js @@ -271,6 +271,14 @@ const listenerForAddr = (addr, SEA) => async (order, orderID) => { */ const invoicePaidCb = async paidInvoice => { logger.info(orderID, 'INVOICE PAID') + // Recycle + require('../../Mediator') + .getGun() + .get('orderNodes') + .get(addr) + .get(orderID) + .put(null) + let breakError = null let orderMetadata //eslint-disable-line init-declarations const hashString = paidInvoice.r_hash.toString('hex') @@ -573,14 +581,6 @@ const listenerForAddr = (addr, SEA) => async (order, orderID) => { ) } }) - } finally { - // Recycle - require('../../Mediator') - .getGun() - .get('orderNodes') - .get(addr) - .get(orderID) - .put(null) } }