Conversation
|
@copilot Please review it |
Reviewed the changes. The PR looks good overall — the migration from global/class-level state to instance-based context managers is clean and the resource lifecycle management with One issue I found and fixed: Code review and CodeQL security scan both passed with no issues. |
|
No danger of race condition or sqlite files being locked after force-close? How is "fill hisitorical data" writing to disk right now? Row by row with sqlite? Or polars conversion first? |
Race conditions / locking after force-close: Each
For force-close (process killed), SQLite WAL recovery handles uncommitted writes on next open. The yoyo migration lock is handled by How "fill historical data" writes to disk: The download path is: CSV download → The "fill holes" (recent gaps) path also uses |
|
@copilot Would it be much slower if we do not use polars after downloading history data, and insert row by row to reduce memory usage? |
No, it wouldn't be meaningfully slower. The actual bottlenecks are network I/O (downloading the ZIP files) and disk I/O (SQLite What polars is doing in this path: So the polars DataFrame here is essentially an intermediate container between two Python list operations. Removing it (CSV → Python list of The one genuine polars value in the current path is |
No description provided.