import { AppDataSource, SystemConfig, initDatabase } from '../models/index.js';
import { getPythonServiceBaseUrl } from '../services/PythonServiceConfigService.js';

async function main() {
  await initDatabase();

  const url = await getPythonServiceBaseUrl();
  console.log('Effective Python service base URL:', url);

  const repo = AppDataSource.getRepository(SystemConfig);
  const row = await repo.findOne({ where: { configKey: 'python_publish_service_url' } });
  console.log('system_config.python_publish_service_url row:', row);
}

main().catch((err) => {
  console.error(err);
  process.exit(1);
});

