mirror of
https://github.com/AustinKelsay/plebdevs.git
synced 2025-04-19 19:01:19 +00:00
Log to debug polling
This commit is contained in:
parent
409c844748
commit
c8923191f9
@ -10,9 +10,9 @@ const BACKEND_URL = process.env.BACKEND_URL;
|
||||
|
||||
async function pollPaymentStatus(baseUrl, name, paymentHash, maxAttempts = 300, interval = 1000) {
|
||||
for (let i = 0; i < maxAttempts; i++) {
|
||||
console.log(`Polling payment status for ${name}... (${i}/${maxAttempts})`);
|
||||
try {
|
||||
const response = await axios.get(`${baseUrl}/api/lightning-address/verify/${name}/${paymentHash}`);
|
||||
console.log(`Polling payment status for ${name}... (${i}/${maxAttempts}), response:`, response.data);
|
||||
|
||||
if (response.data.status === "OK" && response.data.settled) {
|
||||
return true;
|
||||
|
Loading…
x
Reference in New Issue
Block a user