Skip to content

Commit aa91961

Browse files
committed
test
1 parent 0903526 commit aa91961

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

app.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,15 @@ async def main():
193193
# Set the stop condition when receiving SIGTERM.
194194
loop = asyncio.get_running_loop()
195195
stop = loop.create_future()
196-
loop.add_signal_handler(signal.SIGTERM, stop.set_result, None)
196+
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)
197205

198206
port = int(os.environ.get("PORT", "8001"))
199207
async with serve(handler, "", port, process_request=health_check):

0 commit comments

Comments
 (0)