Skip to content

Commit 11f56bc

Browse files
committed
feat(r18): store diagnostics history under canonical Doctor data dir
1 parent 07750ce commit 11f56bc

File tree

1 file changed

+3
-15
lines changed

1 file changed

+3
-15
lines changed

services/diagnostics/store.py

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
IssueStatus,
2121
ReportMetadata,
2222
)
23+
from services.doctor_paths import get_doctor_data_dir
2324

2425
logger = logging.getLogger("comfyui-doctor.diagnostics.store")
2526

@@ -72,21 +73,8 @@ def __init__(self, storage_dir: Optional[str] = None, max_reports: int = DEFAULT
7273

7374
def _get_default_storage_dir(self) -> Path:
7475
"""Get default storage directory."""
75-
# Try ComfyUI user directory first
76-
try:
77-
import folder_paths
78-
user_dir = folder_paths.get_user_directory()
79-
return Path(user_dir) / "comfyui-doctor" / "diagnostics"
80-
except ImportError:
81-
pass
82-
83-
# Fallback to system-specific user data
84-
if os.name == "nt":
85-
base = Path(os.environ.get("APPDATA", Path.home() / "AppData" / "Roaming"))
86-
else:
87-
base = Path(os.environ.get("XDG_DATA_HOME", Path.home() / ".local" / "share"))
88-
89-
return base / "comfyui-doctor" / "diagnostics"
76+
# R18: All persistence should hang off the canonical Doctor data dir.
77+
return Path(get_doctor_data_dir()) / "diagnostics"
9078

9179
def _load(self):
9280
"""Load store from disk."""

0 commit comments

Comments
 (0)