From 00acd745f4327a4444936c87fe8c69ede9eb604b Mon Sep 17 00:00:00 2001 From: Ozzie Isaacs Date: Sat, 30 Dec 2023 19:08:57 +0100 Subject: [PATCH] Fix tornado deprecation warning --- cps/server.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cps/server.py b/cps/server.py index 0b6d2fb3..ebf967e9 100644 --- a/cps/server.py +++ b/cps/server.py @@ -21,6 +21,7 @@ import os import errno import signal import socket +import asyncio try: from gevent.pywsgi import WSGIServer @@ -326,4 +327,5 @@ class WebServer(object): if restart: self.wsgiserver.call_later(1.0, self.wsgiserver.stop) else: - self.wsgiserver.add_callback_from_signal(self.wsgiserver.stop) + self.wsgiserver.asyncio_loop.call_soon_threadsafe(self.wsgiserver.stop) +