-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Test getting worker pid and startup/shutdown hooks.
- Loading branch information
1 parent
ff77f67
commit 08dec1d
Showing
1 changed file
with
30 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,35 @@ | ||
import logging | ||
from activator.activator import cleanup_worker | ||
|
||
|
||
def pre_fork(server, worker): | ||
logging.warning("Worker %s about to be forked.", worker.pid) | ||
|
||
|
||
def post_fork(server, worker): | ||
logging.warning("Worker %s has been forked.", worker.pid) | ||
|
||
|
||
def post_worker_init(worker): | ||
logging.warning("Worker %s has a WSGI application [post_worker_init].", worker.pid) | ||
|
||
|
||
def worker_exit(server, worker): | ||
logging.warning("Worker %s has been exited [worker_exit].", worker.pid) | ||
cleanup_worker() | ||
|
||
|
||
def worker_int(worker): | ||
logging.warning("Worker %s exited on SIGINT or SIGQUIT.", worker.pid) | ||
|
||
|
||
def worker_abort(worker): | ||
logging.warning("Worker %s received SIGABRT.", worker.pid) | ||
|
||
|
||
def child_exit(server, worker): | ||
logging.warning("Worker %s has been exited [child_exit].", worker.pid) | ||
|
||
|
||
def nworkers_changed(server, new_value, old_value): | ||
logging.warning("Worker count has changed from %s to %s.", old_value, new_value) |