Fix: db_cleanup pool, error logging, cleanup unused vars #12
Gitzilla review complete
No actionable issues found.
After analyzing this PR thoroughly, I find no actionable defects. The changes are:
-
Database cleanup now uses shared connection pool: The
DatabaseCleanupstruct now acceptsArc<PriceDatabase>in its constructor and usesself.database.get_connection()to obtain pooled connections instead of opening its ownDATABASE_PATHdirectly. This improves resource management and concurrency handling. -
Error logging in aggregation: The
aggregate_bucketsfunction now useswarn!to log failures when retrieving open/close prices from source buckets, falling back toavg_priceinstead of silently using the fallback value. -
Unused variable cleanup: The
_effective_startvariable was removed from health.rs (it computedif start_time > 0 { start_time } else { now }but was never used in the actual health check logic). TheDATABASE_PATHimport was removed from db_cleanup.rs since it's no longer needed.
The code changes are sound and accomplish the stated objectives without introducing runtime defects.
Details
No actionable issues found in this review pass.