diff options
author | Max Romanov <max.romanov@nginx.com> | 2021-07-29 19:50:39 +0300 |
---|---|---|
committer | Max Romanov <max.romanov@nginx.com> | 2021-07-29 19:50:39 +0300 |
commit | fa9fb29be221e0393562831a9e3bcba416652f60 (patch) | |
tree | bc3e1a28d7915735507c64a62199a189bfb8231f /test/python/restart/longstart.py | |
parent | f3a1c1deb541784b2b0ed179514e4d5eba9fe626 (diff) | |
download | unit-fa9fb29be221e0393562831a9e3bcba416652f60.tar.gz unit-fa9fb29be221e0393562831a9e3bcba416652f60.tar.bz2 |
Application restart introduced.
When processing a restart request, the router sends a QUIT message to all
existing processes of the application. Then, a new shared application port is
created to ensure that new requests won't be handled by the old processes of
the application.
Diffstat (limited to 'test/python/restart/longstart.py')
-rw-r--r-- | test/python/restart/longstart.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/test/python/restart/longstart.py b/test/python/restart/longstart.py new file mode 100644 index 00000000..777398ac --- /dev/null +++ b/test/python/restart/longstart.py @@ -0,0 +1,10 @@ +import os +import time + +time.sleep(2) + +def application(environ, start_response): + body = str(os.getpid()).encode() + + start_response('200', [('Content-Length', str(len(body)))]) + return [body] |