Skip to content

Commit c289701

Browse files
authored
Removed SIGHUP handler on win32. (#334)
1 parent cdb431b commit c289701

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

docs/guide/cli.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ To enable this option simply pass the `--reload` or `-r` option to worker taskiq
8484
Also this option supports `.gitignore` files. If you have such file in your directory, it won't reload worker
8585
when you modify ignored files. To disable this functionality pass `--do-not-use-gitignore` option.
8686

87-
### Graceful reload
87+
### Graceful reload (available only on Unix systems)
8888

8989
To perform graceful reload, send `SIGHUP` signal to the main worker process. This action will reload all workers with new code. It's useful for deployment that requires zero downtime, but don't use orchestration tools like Kubernetes.
9090

taskiq/cli/worker/process_manager.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import logging
22
import signal
3+
import sys
34
from contextlib import suppress
45
from dataclasses import dataclass
56
from multiprocessing import Event, Process, Queue, current_process
@@ -174,10 +175,11 @@ def __init__(
174175
shutdown_handler = get_signal_handler(self.action_queue, ShutdownAction())
175176
signal.signal(signal.SIGINT, shutdown_handler)
176177
signal.signal(signal.SIGTERM, shutdown_handler)
177-
signal.signal(
178-
signal.SIGHUP,
179-
get_signal_handler(self.action_queue, ReloadAllAction()),
180-
)
178+
if sys.platform != "win32":
179+
signal.signal(
180+
signal.SIGHUP,
181+
get_signal_handler(self.action_queue, ReloadAllAction()),
182+
)
181183

182184
self.workers: List[Process] = []
183185

0 commit comments

Comments
 (0)