We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0903526 commit aa91961Copy full SHA for aa91961
app.py
@@ -193,7 +193,15 @@ async def main():
193
# Set the stop condition when receiving SIGTERM.
194
loop = asyncio.get_running_loop()
195
stop = loop.create_future()
196
- loop.add_signal_handler(signal.SIGTERM, stop.set_result, None)
+
197
+ def handler():
198
+ print(stop.cancelled())
199
+ print(stop.done())
200
+ print(stop.exception())
201
+ print(stop.result())
202
+ stop.set_result(None)
203
204
+ loop.add_signal_handler(signal.SIGTERM, handler)
205
206
port = int(os.environ.get("PORT", "8001"))
207
async with serve(handler, "", port, process_request=health_check):
0 commit comments