You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/guide/cli.md
+15-1Lines changed: 15 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -86,13 +86,26 @@ when you modify ignored files. To disable this functionality pass `--do-not-use-
86
86
87
87
### Graceful reload (available only on Unix systems)
88
88
89
-
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.
89
+
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 without using heavy orchestration tools like Kubernetes.
90
+
90
91
91
92
```bash
92
93
taskiq worker my_module:broker
93
94
kill -HUP <main pid>
94
95
```
95
96
97
+
### Graceful and force shutdowns
98
+
99
+
If you send `SIGINT` or `SIGKILL` to the main process by pressing <kbd>Ctrl</kbd>+<kbd>C</kbd> or using the `kill` command, it will initiate the shutdown process.
100
+
By default, it will stop fetching new messages immediately after receiving the signal but will wait for the completion of all currently executing tasks.
101
+
102
+
If you don't want to wait too long for tasks to complete each time you shut down the worker, you can either send termination signals three times to the main process to perform a hard kill or configure the `--wait-tasks-timeout` to set a hard time limit for shutting down.
103
+
104
+
::: tip Cool tip
105
+
The number of signals before a hard kill can be configured with the `--hardkill-count` CLI argument.
106
+
:::
107
+
108
+
96
109
### Other parameters
97
110
98
111
*`--no-configure-logging` - disables default logging configuration for workers.
@@ -107,6 +120,7 @@ kill -HUP <main pid>
107
120
*`max-tasks-per-child` - maximum number of tasks to be executed by a single worker process before restart.
108
121
*`--shutdown-timeout` - maximum amount of time for graceful broker's shutdown in seconds.
109
122
*`--wait-tasks-timeout` - if cannot read new messages from the broker or maximum number of tasks is reached, worker will wait for all current tasks to finish. This parameter sets the maximum amount of time to wait until shutdown.
123
+
*`--hardkill-count` - Number of termination signals to the main process before performing a hardkill.
0 commit comments