Source identity
| Field | Recorded value |
|---|---|
| Source type | GitHub source |
| Original record | Janady13/feedthejoe-hive / sync.py |
| Date | Not specified in source |
| Repository | Janady13/feedthejoe-hive |
| Revision | 86ded0f8164c8365910096bfef90f69e9bb68824 |
| Branch | main |
| Path or archive member | sync.py |
| Original SHA-256 | c62c97ee9e0ee1edb7248b28f3b5f225035640a94d3b8d95bfe4524e9dc01e6c |
| Git blob SHA | 5d7e8e8d11fe91f30abd124c65d1deb9d7986bde |
| Reading-copy SHA-256 | c62c97ee9e0ee1edb7248b28f3b5f225035640a94d3b8d95bfe4524e9dc01e6c |
Recovered source transcript
Download complete source text ↓38 lines · 0.8 KB
from fastapi import FastAPI
app = FastAPI()
status = {"agents": 0, "running": False}
@app.get("/healthz")
async def healthz():
return {"status": "ok"}
@app.post("/start_agents")
async def start_agents():
status["agents"] += 1
status["running"] = True
return status
@app.post("/stop_agents")
async def stop_agents():
status["agents"] = max(0, status["agents"] - 1)
if status["agents"] == 0:
status["running"] = False
return status
@app.get("/status")
async def get_status():
return status
@app.get("/")
async def index():
return {
"routes": {
"/healthz": "check health",
"/start_agents": "start workers",
"/stop_agents": "stop workers",
"/status": "status view"
}
}