import { checkInactivity } from "../services/cronService.js";

/**
 * Standalone Inactivity Checker Worker
 * Designed to be run by PM2 cron_restart
 */
async function runInactivityCheck() {
    console.log("🔄 [WORKER] Starting Inactivity Check...");
    
    try {
        await checkInactivity();
        console.log("✅ [WORKER] Inactivity check complete.");
    } catch (error) {
        console.error("❌ [WORKER] Critical error in Inactivity Worker:", error);
    } finally {
        process.exit(0);
    }
}

// Run the worker
runInactivityCheck();
