SyncExchangesFromCoinGecko
Purpose
Загружает список бирж из CoinGecko и upsert-ит данные в exchanges.
Код: internal/worker/activities/sync_exchanges.go
Input / Output
Input: отсутствует.
Output (models.SyncExchangesResult):
- exchanges_processed, exchanges_inserted, exchanges_updated
- errors[], has_errors
External Dependencies
- API: CoinGecko
/api/v3/exchanges?per_page=250 - DB:
exchanges
Idempotency
- Upsert по
exchange_id. - Повторный запуск безопасен и не создает дубликаты.
Error Taxonomy
database pool is not initialized- сетевые/HTTP ошибки CoinGecko
- SQL upsert/tx commit ошибки
Callers
SyncExchangesWorkflowSyncExchangeCoinsWorkflow(bootstrap prerequisite)
Observability
- Логи:
Fetching exchanges from CoinGecko API,Exchange sync completed