moonraker: prevent duplicate failed components

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
This commit is contained in:
Eric Callahan 2021-11-25 17:15:58 -05:00
parent 2a0be55a8d
commit f0831cbe3c
1 changed files with 2 additions and 1 deletions

View File

@ -239,7 +239,8 @@ class Server:
except Exception:
msg = f"Unable to load component: ({component_name})"
logging.exception(msg)
self.failed_components.append(component_name)
if component_name not in self.failed_components:
self.failed_components.append(component_name)
if isinstance(default, SentinelClass):
raise ServerError(msg)
return default