this repo has no description
3
fork

Configure Feed

Select the types of activity you want to include in your feed.

bug: ignore cron monitor in dev

+9 -8
+9 -8
src/features/services/check_hn.ts
··· 1 1 import { CronJob } from "cron"; 2 2 import * as Sentry from "@sentry/bun"; 3 - import { db } from "../../index"; 3 + import { db, environment } from "../../index"; 4 4 import { 5 5 users as usersTable, 6 6 stories as storiesTable, ··· 522 522 */ 523 523 export function setupHackerNewsMonitoring() { 524 524 // Create and start the scheduled job 525 - const job = CronJobWithCheckIn.from({ 526 - cronTime: CHECK_INTERVAL, // Check every 5 minutes (configurable) 527 - onTick: checkHackerNews, 528 - start: true, 529 - timeZone: "UTC", 530 - }); 525 + if (environment === "production") { 526 + const job = CronJobWithCheckIn.from({ 527 + cronTime: CHECK_INTERVAL, // Check every 5 minutes (configurable) 528 + onTick: checkHackerNews, 529 + start: true, 530 + timeZone: "UTC", 531 + }); 532 + } 531 533 532 534 // Run immediately on startup 533 535 checkHackerNews(); 534 536 535 537 console.log("HackerNews monitoring service started"); 536 - return job; 537 538 }