We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f4a6d82 commit 01e473dCopy full SHA for 01e473d
scrapyd_k8s/api.py
@@ -25,7 +25,14 @@ def healthz():
25
26
@app.get("/daemonstatus.json")
27
def api_daemonstatus():
28
- return { "status": "ok", "spiders": 0 }
+ jobs = list(launcher.listjobs())
29
+ return {
30
+ "node_name": config.scrapyd().get("node_name", launcher.get_node_name()),
31
+ "status": "ok",
32
+ "pending": len([j for j in jobs if j['state'] == 'pending']),
33
+ "running": len([j for j in jobs if j['state'] == 'running']),
34
+ "finished": len([j for j in jobs if j['state'] == 'finished'])
35
+ }
36
37
@app.post("/schedule.json")
38
def api_schedule():
0 commit comments