# ETL: 每5分钟增量同步 llmusage → dm_model_call_fact ip = request['client_ip'] if ip not in ['127.0.0.1']: return ip import json from sage_datamart.etl import ensure_tables, sync_call_fact env = request._run_ns async with get_sor_context(env, 'sage_datamart') as sor: await ensure_tables(sor) count = await sync_call_fact(sor) return json.dumps({'status': 'ok', 'synced': count})