Skip to content

Handle missing SIGHUP on Windows #21

@rtr1

Description

@rtr1

SIGHUP is not present on Windows, so the crontask management command crashes with AttributeError: module 'signal' has no attribute 'SIGHUP'.

If I change these lines in crontask.py:

def launch_scheduler(self, lock, scheduler):
    signal.signal(signal.SIGHUP, kill_softly)

To this:

def launch_scheduler(self, lock, scheduler):
    if hasattr(signal, "SIGHUP"):
        signal.signal(signal.SIGHUP, kill_softly)

Then it works on Windows, and CTRL-C sends SIGINT and stops the worker as expected.

Metadata

Metadata

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions