djm / python-scrapyd-api

A Python wrapper for working with Scrapyd's API.
BSD 2-Clause "Simplified" License
267 stars 32 forks source link

Priority with python-scrapyd-api #9

Open vokhuongcse0604 opened 7 years ago

vokhuongcse0604 commented 7 years ago

I want to set priority for my spider. I done when set on scrapyd: curl http://localhost:6800/schedule.json -d project=myproject -d spider=somespider -d priority=1 How can i do like that on python-scrapyd-api? Thanks.

djm commented 7 years ago

@vokhuongcse0604

Looks like priority was a non-documented feature until recently.

The code in scrapyd just pops the priority kwarg off the arguments sent, so this can be done with our API with no code changes:

scrapyd.schedule('myproject', 'somespider', priority=1.1)

Priority should be an integer or a float.


Having said no code changes: I will update the docs to state this, so I'll leave this ticket open for now.

Digenis commented 7 years ago

I documented it in 1.1.1 after https://github.com/scrapy/scrapyd/issues/144#issuecomment-218963899 If you use priorities, make sure you checkout this pitfall https://github.com/scrapy/scrapyd/issues/187 Things should change in scrapyd-1.3

djm commented 7 years ago

@Digenis Yup, that's what I meant by poorly worded "until recently". Thank you very much for doing it and that helpful extra comment.