scrapyd
scrapyd copied to clipboard
listjobs.json response does not contain parameters
Is there a way to retrieve the parameters of a scheduled task?
Currently
$ curl http://localhost:6800/schedule.json -d project=myproject -d spider=somespider -d setting=DOWNLOAD_DELAY=2 -d arg1=val1
Returns
{"status": "ok",
"pending": [{"id": "78391cc0fcaf11e1b0090800272a6d06", "spider": "somespider"}]
}
I wonder if there is a way to get:
{"status": "ok",
"pending": [{
"id": "78391cc0fcaf11e1b0090800272a6d06",
"spider": "somespider",
"setting": {"DOWNLOAD_DELAY": 2},
"arg1": "val1"
}]
}
@sieira, no. This information exists only for pending jobs. I'd say scrapyd is far from providing this feature. Also, I think we shouldn't provide an API for this until we rewrite the webservice to accept parameters in a better format.
Would you be willing to accept a patch with this enhancement?
- store the arguments in
ScrapyProcessProtocol()
(around https://github.com/scrapy/scrapyd/blob/4520c45acc115d0fc766eae30788468a77690433/scrapyd/launcher.py#L44) - report the arguments in
listjobs.json
for pending, running and finished jobs
Maybe related: #39
store the arguments in ScrapyProcessProtocol()
Noting that this was the approach in #254
See also comments in PR #272