Skip to content

SyncExchangeCoinsWorkflow

Purpose

Оркестратор sync монет/сетей по нескольким биржам с частичным успехом и post-step enrichment для Gate.

Код: internal/worker/workflows/sync_exchange_coins.go

Input / Output

Input (models.SyncExchangeCoinsInput): - force_full_refresh - soft_delete_grace_days - child_max_parallel

Output (models.SyncExchangeCoinsResult): - exchanges_total, exchanges_succeeded, exchanges_failed, exchanges_skipped - coins_upserted, networks_upserted, mappings_resolved, quarantine_added - gate_wallet_enrichment - errors[], has_errors

Called Activities / Children

Activities: - NeedsExchangeCatalogBootstrapForCoins - SyncExchangesFromCoinGecko (только если bootstrap required)

Child workflows: - SyncExchangeCoinsExchangeWorkflow - SyncGateWalletEnrichmentWorkflow (только если gate child = ok)

Retry / Failure Behavior

  • Activity timeout: 2m, retry max_attempts=3
  • Child retry: max_attempts=2
  • Ошибка одного child не валит весь run (агрегируется в errors[]), финальный статус остается partial-success.

Manual Run

docker compose exec -T temporal temporal workflow start \
  --address temporal:7233 --namespace default --task-queue default \
  --type SyncExchangeCoinsWorkflow \
  --workflow-id sync-exchange-coins-manual-$(date +%s) \
  --input '{"force_full_refresh":false,"soft_delete_grace_days":30,"child_max_parallel":2}'
  • Tables: exchange_assets, exchange_asset_networks, exchange_symbol_assets, exchange_asset_mappings, global_assets, global_asset_networks, asset_mapping_quarantine
  • Логи: starting exchange coins sync, exchange catalog bootstrap required