moonraker: remove unnecessary "check_ready" request.
There is no longer a need for Moonraker to check in with Klippy's `moonraker/check_ready` request. It can now simply check in with the "info" request. Signed-off-by: Eric Callahan <arksine.code@gmail.com>
This commit is contained in:
parent
0d29d0f811
commit
4191aac63f
|
@ -21,7 +21,7 @@ MAX_UPLOAD_SIZE = 200 * 1024 * 1024
|
||||||
# These endpoints are reserved for klippy/server communication only and are
|
# These endpoints are reserved for klippy/server communication only and are
|
||||||
# not exposed via http or the websocket
|
# not exposed via http or the websocket
|
||||||
RESERVED_ENDPOINTS = [
|
RESERVED_ENDPOINTS = [
|
||||||
"list_endpoints", "moonraker/check_ready", "moonraker/get_configuration"
|
"list_endpoints", "moonraker/get_configuration"
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -218,8 +218,11 @@ class Server:
|
||||||
await self._request_endpoints()
|
await self._request_endpoints()
|
||||||
if not self.server_configured:
|
if not self.server_configured:
|
||||||
await self._request_config()
|
await self._request_config()
|
||||||
await self._request_ready()
|
if not self.is_klippy_ready:
|
||||||
if self.is_klippy_ready:
|
await self._request_ready()
|
||||||
|
if self.is_klippy_ready and self.server_configured:
|
||||||
|
# Make sure we have all registered endpoints
|
||||||
|
await self._request_endpoints()
|
||||||
self.init_cb.stop()
|
self.init_cb.stop()
|
||||||
|
|
||||||
async def _request_endpoints(self):
|
async def _request_endpoints(self):
|
||||||
|
@ -243,22 +246,24 @@ class Server:
|
||||||
self.server_configured = True
|
self.server_configured = True
|
||||||
else:
|
else:
|
||||||
logging.info(
|
logging.info(
|
||||||
"\nError receiving configuration. This indicates a potential\n"
|
"Error receiving configuration. This indicates a "
|
||||||
"configuration issue in printer.cfg. Please check klippy.log\n"
|
"potential configuration issue in printer.cfg. Please check "
|
||||||
"for more information")
|
"klippy.log for more information")
|
||||||
|
|
||||||
async def _request_ready(self):
|
async def _request_ready(self):
|
||||||
request = self.make_request(
|
request = self.make_request("info", "GET", {})
|
||||||
"moonraker/check_ready", "GET", {})
|
|
||||||
result = await request.wait()
|
result = await request.wait()
|
||||||
if not isinstance(result, ServerError):
|
if not isinstance(result, ServerError):
|
||||||
is_ready = result.get("is_ready", False)
|
is_ready = result.get("is_ready", False)
|
||||||
if is_ready:
|
if is_ready:
|
||||||
self._set_klippy_ready()
|
self._set_klippy_ready()
|
||||||
if not self.is_klippy_ready:
|
else:
|
||||||
|
msg = result.get("message", "Klippy Not Ready")
|
||||||
|
logging.info(msg)
|
||||||
|
else:
|
||||||
logging.info(
|
logging.info(
|
||||||
"\nKlippy not ready. This indicates a that Klippy may have\n"
|
"Klippy Info request error. This indicates a that Klippy "
|
||||||
"experienced an error during startup. Please check\n"
|
"may have experienced an error during startup. Please check "
|
||||||
"klippy.log for more information")
|
"klippy.log for more information")
|
||||||
|
|
||||||
def _load_config(self, config):
|
def _load_config(self, config):
|
||||||
|
|
Loading…
Reference in New Issue