aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2024-10-01 23:33:46 -0700
committerAdam Soltys <[email protected]>2024-10-01 23:33:46 -0700
commita59d10ef183d2f40772f231116890c13b235fbb2 (patch)
tree14fdde663f5f41bbc381c34474b18eddb401c0db
parenta41ba43f2f474b36e3da4c8cedc213f7fb455b3c (diff)
downloadcoinos-server-a59d10ef183d2f40772f231116890c13b235fbb2.tar.gz
coinos-server-a59d10ef183d2f40772f231116890c13b235fbb2.zip
check
-rw-r--r--index.ts2
-rw-r--r--lib/payments.ts6
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);
}
};