aboutsummaryrefslogtreecommitdiffstats
path: root/lib/sync.js
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2022-04-02 02:30:19 -0400
committerAdam Soltys <[email protected]>2022-04-02 02:30:19 -0400
commit2e585488fd58e90264da5a5e5c25e1e397b56145 (patch)
treeab3ea426479785b8093e8f8247117ae423c8ee86 /lib/sync.js
parent5576f07a5a29bc8f2cb0695f5e12b4603b2771f9 (diff)
downloadcoinos-server-2e585488fd58e90264da5a5e5c25e1e397b56145.tar.gz
coinos-server-2e585488fd58e90264da5a5e5c25e1e397b56145.zip
check invoices up to 30 days ago
Diffstat (limited to 'lib/sync.js')
-rw-r--r--lib/sync.js20
1 files changed, 2 insertions, 18 deletions
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"]