Spaces:
Build error
Build error
Commit History
-
fix: centralize + desktop-mode-adapt the logs directory (P-1)
New finding while implementing this: config/settings.py's LOGS_PATH constant was dead code -- grepped every consumer, zero hits anywhere outside its own definition. The 3 real log-writing call sites each independently hardcoded or recomputed their own path instead: - scrapers/base_scraper.py: a bare CWD-relative "logs" string - api/middleware/audit_logger.py: __file__-relative, 3 dirname() calls up to project root - blockchain/audit_chain.py: __file__-relative, 2 dirname() calls up to project root (different file depth, same target) All 3 resolve to the identical directory TODAY only because Docker's fixed WORKDIR makes CWD == project root -- a coincidence, not a guarantee. A desktop build has no such guarantee: a double-clicked app's CWD is unpredictable, so the CWD-relative scraper logs and the __file__-relative audit logs could silently end up in two different, unrelated directories the moment this ships as a desktop app. Fix: LOGS_PATH is now desktop-mode-aware (same…6d12c24
-
fix(M-09): guard os.makedirs() in save_json() against empty dirname -- filenames without path component no longer crash
0e43bbf
-
fix(scrapers): BUG-29 -- logs dir may not exist in Docker environments
scrapers/base_scraper.py called logger.add('logs/{name}.log') in every scraper __init__ without ensuring the directory exists first. In Docker and HuggingFace Spaces, logs/ may be read-only or absent. loguru.add() would silently fail or throw FileNotFoundError. Fix: added os.makedirs('logs', exist_ok=True) before logger.add and added enqueue=True, catch=True to prevent log write failures from crashing the scraper process.b62bf48
-
fix(scrapers): add missing import os to mca_scraper.py
- mca_scraper.py had os.getenv() at class level without importing os - base_scraper.py already fixed with load_dotenv() in previous commit - All 7 scrapers now import os correctly421aac9
-
feat: add requirements.txt and base_scraper.py - Day 2
1c02240