Skip to content

Commit 6cd92cd

Browse files
authored
Merge pull request #47 from johncmacy/patch-2
Test if `signal` has attribute `SIGQUIT`
2 parents 2fba52a + da7fe87 commit 6cd92cd

File tree

3 files changed

+12
-2
lines changed

3 files changed

+12
-2
lines changed

README.md

+4
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,10 @@ jobs in the "NEW" or "READY" states will be returned.
243243

244244
It may be necessary to supply a DATABASE_PORT environment variable.
245245

246+
## Windows support
247+
248+
Windows is supported on a best-effort basis only, and is not covered by automated or manual testing.
249+
246250
## Code of conduct
247251

248252
For guidelines regarding the code of conduct when contributing to this repository please review [https://www.dabapps.com/open-source/code-of-conduct/](https://www.dabapps.com/open-source/code-of-conduct/)

django_dbq/management/commands/worker.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,11 @@ def __init__(self, name, rate_limit_in_seconds):
8484

8585
def init_signals(self):
8686
signal.signal(signal.SIGINT, self.shutdown)
87-
signal.signal(signal.SIGQUIT, self.shutdown)
87+
88+
# for Windows, which doesn't support the SIGQUIT signal
89+
if hasattr(signal, "SIGQUIT"):
90+
signal.signal(signal.SIGQUIT, self.shutdown)
91+
8892
signal.signal(signal.SIGTERM, self.shutdown)
8993

9094
def shutdown(self, signum, frame):

django_dbq/tests.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,9 @@ def test_queue_depth_multiple_queues(self):
103103
)
104104

105105
stdout = StringIO()
106-
call_command("queue_depth", queue_name=("default", "testqueue",), stdout=stdout)
106+
call_command(
107+
"queue_depth", queue_name=("default", "testqueue",), stdout=stdout,
108+
)
107109
output = stdout.getvalue()
108110
self.assertEqual(output.strip(), "event=queue_depths default=2 testqueue=2")
109111

0 commit comments

Comments
 (0)