diff options
| author | Adam Soltys <[email protected]> | 2024-10-01 23:33:46 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2024-10-01 23:33:46 -0700 |
| commit | a59d10ef183d2f40772f231116890c13b235fbb2 (patch) | |
| tree | 14fdde663f5f41bbc381c34474b18eddb401c0db | |
| parent | a41ba43f2f474b36e3da4c8cedc213f7fb455b3c (diff) | |
| download | coinos-server-a59d10ef183d2f40772f231116890c13b235fbb2.tar.gz coinos-server-a59d10ef183d2f40772f231116890c13b235fbb2.zip | |
check
| -rw-r--r-- | index.ts | 2 | ||||
| -rw-r--r-- | lib/payments.ts | 6 |
2 files changed, 3 insertions, 5 deletions
@@ -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); } }; |
