From 646e97ad556b078499ac2337b5d80d494e954fdb Mon Sep 17 00:00:00 2001 From: Eric Callahan Date: Sat, 10 Jul 2021 12:39:03 -0400 Subject: [PATCH] machine: replace reference to ioloop with eventloop Signed-off-by: Eric Callahan --- moonraker/components/machine.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/moonraker/components/machine.py b/moonraker/components/machine.py index ea8005b..6c476b4 100644 --- a/moonraker/components/machine.py +++ b/moonraker/components/machine.py @@ -11,7 +11,6 @@ import pathlib import logging import platform import distro -from tornado.ioloop import IOLoop # Annotation imports from typing import ( @@ -81,7 +80,8 @@ class Machine: "reboot_machine", self.reboot_machine) # Retreive list of services - IOLoop.current().spawn_callback(self._find_active_services) + event_loop = self.server.get_event_loop() + event_loop.register_callback(self._find_active_services) async def _handle_machine_request(self, web_request: WebRequest) -> str: ep = web_request.get_endpoint() @@ -113,8 +113,8 @@ class Machine: if action != "restart": raise self.server.error( f"Service action '{action}' not available for moonraker") - IOLoop.current().spawn_callback( - self.do_service_action, action, name) + event_loop = self.server.get_event_loop() + event_loop.register_callback(self.do_service_action, action, name) elif name in self.available_services: await self.do_service_action(action, name) else: