From 2e585488fd58e90264da5a5e5c25e1e397b56145 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Sat, 2 Apr 2022 02:30:19 -0400 Subject: check invoices up to 30 days ago --- lib/sync.js | 20 ++------------------ 1 file changed, 2 insertions(+), 18 deletions(-) (limited to 'lib/sync.js') diff --git a/lib/sync.js b/lib/sync.js index 10e857b3..6c048388 100644 --- a/lib/sync.js +++ b/lib/sync.js @@ -11,13 +11,13 @@ const init = async () => { } try { - const twoDays = new Date(new Date().setDate(new Date().getDate() - 2)); + const thirtyDays = new Date(new Date().setDate(new Date().getDate() - 30)); ( await db.Invoice.findAll({ where: { createdAt: { - [Op.gt]: twoDays + [Op.gt]: thirtyDays } }, include: { @@ -33,22 +33,6 @@ const init = async () => { console.log(e); } - try { - const accounts = await db.Account.findAll({ - where: { pubkey: { [Op.ne]: null } }, - include: { - model: db.User, - as: "user" - } - }); - - accounts.map(({ address, user: { username } }) => { - addresses[address] = username; - }); - } catch (e) { - console.log(e); - } - payments = ( await db.Payment.findAll({ attributes: ["hash"] -- cgit v1.2.3