From 3d07b66404ea0b592abba5b486453d6d223678a9 Mon Sep 17 00:00:00 2001 From: RockerFlower Date: Mon, 13 May 2024 17:49:27 +0900 Subject: [PATCH] Add console --- pages/api/cron/freshPOAP.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pages/api/cron/freshPOAP.ts b/pages/api/cron/freshPOAP.ts index 57bea3a..4322982 100644 --- a/pages/api/cron/freshPOAP.ts +++ b/pages/api/cron/freshPOAP.ts @@ -19,6 +19,7 @@ export default async function handler(req, res) { try { const lastUpdateTimestamp = await kvClient.get('lastUpdateTimestampOfPOAP') || INITIAL_TIMESTAMP; const currentTimestamp = Math.floor(Date.now() / 1000); + console.info('Last update timestamp:', lastUpdateTimestamp); const query = ` query { @@ -40,8 +41,10 @@ export default async function handler(req, res) { const { data } = await response.json(); const poaps = data.poaps; - const uniqueAddresses: string[] = Array.from(new Set(poaps.map((poap: any) => poap.collector_address))); + console.info('POAPs:', poaps); + const uniqueAddresses: string[] = Array.from(new Set(poaps.map((poap: any) => poap.collector_address))); + console.info('Unique addresses:', uniqueAddresses); for (const address of uniqueAddresses) { await fetch(`/api/poap/v/${address}`, { method: 'GET' }); }