Skip to content

Commit

Permalink
fix: cancel.json now works on Windows, closes #83
Browse files Browse the repository at this point in the history
  • Loading branch information
jpmckinney committed Jul 15, 2024
1 parent e26de50 commit 8ba341b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion docs/news.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ Changed
Fixed
~~~~~

- The :ref:`cancel.json` webservice now works on Windows.
- When managing multiple projects, the next pending job for all but one project was unreported by the :ref:`daemonstatus.json` and :ref:`listjobs.json` webservices, and was not cancellable by the :ref:`cancel.json` webservice.

1.4.3 (2023-09-25)
Expand Down Expand Up @@ -138,7 +139,7 @@ Fixed

- Fix HTTP header types for newer Twisted versions.
- ``DeferredQueue`` no longer hides a pending job when reaching ``max_proc``.
- ``AddVersion``'s arguments' string types no longer break Windows environments.
- The :ref:`addversion.json`` webservice now works on Windows.
- test: Update binary eggs to be compatible with Scrapy 1.x.

Removed
Expand Down
3 changes: 2 additions & 1 deletion scrapyd/webservice.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import sys
import traceback
import uuid
from copy import copy
Expand Down Expand Up @@ -69,7 +70,7 @@ def render_POST(self, txrequest):
args = {k: v[0] for k, v in native_stringify_dict(copy(txrequest.args), keys_only=False).items()}
project = args['project']
jobid = args['job']
signal = args.get('signal', 'TERM')
signal = args.get('signal', 'INT' if sys.platform != 'win32' else 'BREAK')
prevstate = None
queue = self.root.poller.queues[project]
c = queue.remove(lambda x: x["_job"] == jobid)
Expand Down

0 comments on commit 8ba341b

Please sign in to comment.