Spaces:
Sleeping
Sleeping
Commit ·
582aaa1
1
Parent(s): 88fbcdb
Bootstrap worker: FastAPI + health endpoint
Browse filesFiles changed (8)
- .env.exampleAdded+2
- .gitignoreAdded+3
- DockerfileAdded+12
- README.md+7
- app/config.pyAdded+4
- app/health.pyAdded+11
- app/main.pyAdded+6
- requirements.txtAdded+2
12ROOT_FOLDER_ID=13YXKcx2HY2jqf5aaCX3GVngkPm4tp8r8POLL_SECONDS=300123.env__pycache__/*.pyc123456789101112FROM python:3.10-slim
WORKDIR /app
COPY requirements.txt .RUN pip install --no-cache-dir -r requirements.txt
COPY app ./app
EXPOSE 7860
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "7860"]7 unmodified lines89107 unmodified lines---Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference7 unmodified lines8910111213141516177 unmodified lines---Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference# SA Resume WorkerBackground worker service.- Polls Google Drive- Tracks processed files- Emits heartbeat signals
1234import os
ROOT_FOLDER_ID = os.getenv("ROOT_FOLDER_ID")POLL_SECONDS = int(os.getenv("POLL_SECONDS", "300"))1234567891011from fastapi import APIRouterimport time
router = APIRouter()
@router.get("/health")def health(): return { "status": "ok", "ts": int(time.time()) }123456from fastapi import FastAPIfrom app.health import router as health_router
app = FastAPI(title="SA Resume Worker")
app.include_router(health_router)12fastapiuvicorn[standard].env.exampleAdded+2
.gitignoreAdded+3
DockerfileAdded+12
README.md+7
app/config.pyAdded+4
app/health.pyAdded+11
app/main.pyAdded+6
requirements.txtAdded+2