feat(lifespan): wire data pipeline as optional background task
Step 8 in startup — controlled by DATA_PIPELINE=true env var. Runs RPC health checks + 6 block/event indexers.
This commit is contained in:
parent
f2a50fdf71
commit
133c8db6be
1 changed files with 11 additions and 0 deletions
|
|
@ -95,6 +95,17 @@ async def lifespan(_app: FastAPI) -> AsyncIterator[None]:
|
|||
except Exception as exc:
|
||||
log.info("certstream_start_failed err=%s", exc)
|
||||
|
||||
# 8. Data Pipeline — RPC health + blockchain indexers (optional, env-controlled)
|
||||
try:
|
||||
if os.getenv("DATA_PIPELINE", "false").lower() == "true":
|
||||
from app.data.pipeline import DataPipeline
|
||||
import asyncio
|
||||
pipe = DataPipeline()
|
||||
asyncio.create_task(pipe.start())
|
||||
log.info("data_pipeline_started")
|
||||
except Exception as exc:
|
||||
log.info("data_pipeline_skipped err=%s", exc)
|
||||
|
||||
yield
|
||||
|
||||
# Shutdown
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue