From a59d10ef183d2f40772f231116890c13b235fbb2 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Tue, 1 Oct 2024 23:33:46 -0700 Subject: check --- index.ts | 2 +- lib/payments.ts | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/index.ts b/index.ts index 76340303..9b72a6a2 100644 --- a/index.ts +++ b/index.ts @@ -3,7 +3,7 @@ import { auth, admin, optional } from "$lib/auth"; import { listenForLightning } from "$lib/lightning"; import { getLocations } from "$lib/locations"; -import { catchUp, check} from "$lib/payments"; +import { catchUp, check } from "$lib/payments"; import { getFx } from "$lib/rates"; import { sendHeartbeat } from "$lib/sockets"; import { fillPool } from "$lib/nostr"; diff --git a/lib/payments.ts b/lib/payments.ts index 84f9d961..1f67bb1f 100644 --- a/lib/payments.ts +++ b/lib/payments.ts @@ -767,9 +767,7 @@ export let reconcile = async (account, initial = false) => { } }; -let checktime; -let check = async () => { - clearTimeout(checktime); +export let check = async () => { let payments = await db.sMembers("pending"); for (let pr of payments) { @@ -783,7 +781,7 @@ let check = async () => { if (completed) await finalize(completed, p); else if (failed) await reverse(p); - checktime = setTimeout(check, 2000); + setTimeout(check, 2000); } }; -- cgit v1.2.3