From f8a24417133a5c3d0b6f342f96739c56b74fccdb Mon Sep 17 00:00:00 2001 From: brucedone Date: Sun, 27 Mar 2016 18:25:52 +0800 Subject: [PATCH] fix the cancel the pending job return false issue --- scrapyd_api/wrapper.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scrapyd_api/wrapper.py b/scrapyd_api/wrapper.py index 23afde5..216b5e7 100644 --- a/scrapyd_api/wrapper.py +++ b/scrapyd_api/wrapper.py @@ -84,7 +84,7 @@ def cancel(self, project, job): 'job': job } json = self.client.post(url, data=data) - return True if json['prevstate'] == constants.RUNNING else False + return True if json['prevstate'] in [constants.PENDING,constants.RUNNING] else False def delete_project(self, project): """