diff --git a/bun.lockb b/bun.lockb index a262e58..76594cc 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/src/server.ts b/src/server.ts index 16c9b79..ef42b50 100644 --- a/src/server.ts +++ b/src/server.ts @@ -7,7 +7,8 @@ const PORT = process.env.PORT ?? 5010; let cachedLocations: ILocation[]; async function reload(): Promise { - console.log("Loading Dining API..."); + const now = new Date(); + console.log(`Reloading Dining API: ${now}`); const parser = new DiningParser(); const locations = await parser.process(); if ( @@ -67,11 +68,7 @@ app.get("/locations/time/:day/:hour/:min", ({ params: { day, hour, min } }) => { // Cache TTL: 3 hours const interval = 1000 * 60 * 60 * 3; setInterval(() => { - const today = new Date(); - const dayOfWeek = today.getDay(); - if (dayOfWeek === 6) { - reload().catch(console.error); - } + reload().catch(console.error); }, interval); reload().then(() => { diff --git a/src/utils/requestUtils.ts b/src/utils/requestUtils.ts index dfe1775..c5c77d1 100644 --- a/src/utils/requestUtils.ts +++ b/src/utils/requestUtils.ts @@ -10,7 +10,9 @@ export async function getHTMLResponse( retriesLeft = 4 ): Promise { try { + console.log(`Scraping ${url}`); const response = await axios.get(url.toString()); + console.log({"message": `Scraped ${url}`, "html": response.data, "url": url.toString()}); return response.data; } catch (err) { if (!IS_TESTING) console.error(err); diff --git a/src/utils/timeUtils.ts b/src/utils/timeUtils.ts index 67e630e..ef4f793 100644 --- a/src/utils/timeUtils.ts +++ b/src/utils/timeUtils.ts @@ -50,6 +50,5 @@ export function sortAndMergeTimeRanges(timeRanges: ITimeRange[]) { mergedRanges.push(timeRange); } } - console.log(timeRanges, mergedRanges); return mergedRanges; }