System: fix dynamic pathing for crash logs (#535)

This commit is contained in:
Jason Wen
2025-01-07 09:48:29 -05:00
committed by GitHub
parent e682957101
commit d6ec84c068
2 changed files with 8 additions and 1 deletions
+1 -1
View File
@@ -14,7 +14,7 @@ from openpilot.system.hardware.hw import Paths
API_HOST = os.getenv('SUNNYLINK_API_HOST', 'https://stg.api.sunnypilot.ai')
UNREGISTERED_SUNNYLINK_DONGLE_ID = "UnregisteredDevice"
MAX_RETRIES = 6
CRASH_LOG_DIR = '/data/community/crashes'
CRASH_LOG_DIR = Paths.crash_log_root()
class SunnylinkApi(BaseApi):
+7
View File
@@ -70,3 +70,10 @@ class Paths:
return str(Path(Paths.comma_home()) / "media" / "0" / "models")
else:
return "/data/media/0/models"
@staticmethod
def crash_log_root() -> str:
if PC:
return str(Path(Paths.comma_home()) / "community" / "crashes")
else:
return "/data/community/crashes"