File size: 638 Bytes
28a08e7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# auto-sync-test: 2026-06-18T17:04
import os, sys, logging
port = int(os.environ.get('PORT', '7860'))
_logger = logging.getLogger('agente_ai')
_logger.info('START: PORT=%s', port)

# ARCH-F1.5: applica RLS GRANT fix prima di avviare il server.
# Idempotente — no-op se SUPABASE_DB_URL non è configurato o se già eseguito.
try:
    from api.startup_migration import apply_rls_fix_sync
    apply_rls_fix_sync()
except Exception as _mig_exc:
    _logger.warning('START: startup_migration import fallito (non bloccante): %s', _mig_exc)

import uvicorn
uvicorn.run('main:app', host='0.0.0.0', port=port, log_level='info', access_log=True)