import { initDatabase } from '../models/index.js';
import { logger } from '../utils/logger.js';
import { DouyinWorkStatisticsImportService } from '../services/DouyinWorkStatisticsImportService.js';

async function main() {
  try {
    await initDatabase();
    logger.info('[DY WorkStats] Manual run start...');
    await DouyinWorkStatisticsImportService.runDailyImport();
    logger.info('[DY WorkStats] Manual run done.');
    process.exit(0);
  } catch (e) {
    logger.error('[DY WorkStats] Manual run failed:', e);
    process.exit(1);
  }
}

void main();

