Skip to content

SyncExchangesWorkflow

Purpose

Синхронизирует каталог бирж из CoinGecko в таблицу exchanges.

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

Input / Output

Input: отсутствует.

Output (models.SyncExchangesResult): - exchanges_processed - exchanges_inserted - exchanges_updated - errors[] - has_errors

Called Activities / Children

Retry / Failure Behavior

  • Activity timeout: 2m
  • Retry: max_attempts=3, backoff 10s -> 1m
  • Ошибка activity завершает workflow с failed.

Manual Run

docker compose exec -T temporal temporal workflow start \
  --address temporal:7233 --namespace default --task-queue default \
  --type SyncExchangesWorkflow \
  --workflow-id sync-exchanges-manual-$(date +%s)
  • Tables: exchanges
  • Логи: Fetching exchanges from CoinGecko API, Exchange sync completed