|
|
|
@ -129,8 +129,8 @@ def _is_flask_child_process(): |
|
|
|
|
|
|
|
|
|
# --------------------------------------------------------------------- |
|
|
|
|
|
|
|
|
|
def _on_sigint( signum, stack ): #pylint: disable=unused-argument |
|
|
|
|
"""Clean up after a SIGINT.""" |
|
|
|
|
def _on_sig( signum, stack ): #pylint: disable=unused-argument |
|
|
|
|
"""Clean up after a SIGINT/SIGTERM.""" |
|
|
|
|
|
|
|
|
|
# FUDGE! Since we added gRPC test control, we want to shutdown properly and clean things up (e.g. temp files |
|
|
|
|
# created by the gRPC service), but the Flask reloader complicates what we have to do here horribly :-( |
|
|
|
@ -258,7 +258,10 @@ import vasl_templates.webapp.downloads #pylint: disable=cyclic-import |
|
|
|
|
import vasl_templates.webapp.lfa #pylint: disable=cyclic-import |
|
|
|
|
|
|
|
|
|
# install our signal handler (must be done in the main thread) |
|
|
|
|
signal.signal( signal.SIGINT, _on_sigint ) |
|
|
|
|
signal.signal( signal.SIGINT, _on_sig ) |
|
|
|
|
# NOTE: We must handle SIGTERM, so that "docker stop" and scaling down in Kubernetes |
|
|
|
|
# work properly (otherwise it times out and we get SIGKILL'ed :-/). |
|
|
|
|
signal.signal( signal.SIGTERM, _on_sig ) |
|
|
|
|
|
|
|
|
|
# register startup initialization |
|
|
|
|
app.before_request( _on_request ) |
|
|
|
|