import full eventflow project

This commit is contained in:
2026-03-13 17:18:19 +08:00
parent 0edc8f7477
commit bbae58e4fe
21 changed files with 1023 additions and 0 deletions

View File

@@ -0,0 +1,27 @@
import threading
from fastapi import FastAPI
from .routers import analyze, ingest, query
from .services.retry_worker import run_retry_loop
app = FastAPI(title="eventflow-fastapi", version="0.1.0")
app.include_router(ingest.router, prefix="/ingest", tags=["ingest"])
app.include_router(analyze.router, prefix="/analyze", tags=["analyze"])
app.include_router(query.router, prefix="/query", tags=["query"])
_stop = threading.Event()
@app.on_event("startup")
def _startup() -> None:
# Background retry loop so transient gateway 5xx doesn't permanently stall parsing.
t = threading.Thread(target=run_retry_loop, args=(_stop,), daemon=True)
t.start()
@app.on_event("shutdown")
def _shutdown() -> None:
_stop.set()