usage 0.9.1
新功能 1 項
終端機介面不再卡死,底層檔案掃描更省力
之前在終端機裡看用量時,因為一個程式迴圈寫錯(不小心跳過了更新步驟),導致畫面永遠凍結在剛打開的那一秒,再也不會自動更新。現在這個迴圈修好了,畫面會乖乖定時刷新。同時,我們也優化了底層的檔案掃描:以前每次更新畫面,系統都會笨笨地把同一個歷史紀錄檔案重複讀 4 次來算不同時間區間的數字;現在它學聰明了,一次讀完最長的區間然後直接往下分派,大幅省下白費力氣的硬碟讀取。另外,舊版的環境變數和過時的內部代號也一併統一了。就像是顧門口的警衛以前一直忘記看手錶導致從來不換班,而且查房時還同一層樓爬上爬下巡了四遍,現在終於準時交接,而且知道從頂樓一次巡下來最省事。
官方原文
**TUI polling never updated after first fetch**: a continue in poll_usage caused every timeout to jump back to the loop head, leaving the UI frozen at the initial state. Changed to pass so the polling path is actually reached.
**Inconsistent env var name**: USAG_FORCE_GROUP (v0.1.x legacy prefix) renamed to USAGE_FORCE_GROUP to match all other env vars in the project.
**Redundant filesystem scans per refresh**: _refresh_in_background was calling history_loader.load_entries four times per cycle (24h × 2, 168h × 1, 720h × 1). Now loads the 720h superset once and passes it down, eliminating the duplicate I/O.
pricing.py User-Agent updated from the stale usage/0.2 to usage/0.9.
--setup no longer prints a "no migration needed" message on clean installs.