Stefal / rtkbase

Your own GNSS base station for RTK localization with a Web GUI
GNU Affero General Public License v3.0
492 stars 123 forks source link

Fix #421 recreate bug #162 #445

Closed Jef239 closed 1 week ago

Jef239 commented 3 weeks ago

image

In https://github.com/Stefal/rtkbase/commit/20932fa232245f667ba8b818fcbaa0978ab07836 you fix https://github.com/Stefal/rtkbase/issues/421 but recreate https://github.com/Stefal/rtkbase/issues/162

Fix:

--- a/web_app/server.py
+++ b/web_app/server.py
@@ -971,7 +971,12 @@ def getServicesStatus(emit_pingback=True):
             #print("unit qui déconne : ", service["name"])
             service["active"] = service["unit"].isActive()
             service["status"] = service["unit"].status()
-            service["result"] = service["unit"].get_result()
+
+            try:
+                service["result"] = service["unit"].get_result()
+            except AttributeError as e:
+                service["result"] = ""
+
             if service.get("result") == "success" and service.get("status") == "running":
                 service["state_ok"] = True
             elif service.get("result") == "exit-code":
Stefal commented 1 week ago

Yes, I was aware of this error message. https://github.com/Stefal/rtkbase/commit/f21cf08e7a53fa35ab76edbc3cf31a60eb89c186 should fix this in a better way.