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

async function main() {
  try {
    await initDatabase();
    logger.info('[DY Import] Manual run start...');
    const svc = new DouyinAccountOverviewImportService();
    await svc.runDailyImportForAllDouyinAccounts();
    logger.info('[DY Import] Manual run done.');
    process.exit(0);
  } catch (e) {
    logger.error('[DY Import] Manual run failed:', e);
    process.exit(1);
  }
}

void main();

