Skip to content

Fix: db_cleanup uses shared connection pool, log aggregation errors, …

f9ec38a
Select commit
Loading
Failed to load commit list.
Merged

Fix: db_cleanup pool, error logging, cleanup unused vars #12

Fix: db_cleanup uses shared connection pool, log aggregation errors, …
f9ec38a
Select commit
Loading
Failed to load commit list.
GitzillaBot / gitzilla succeeded Mar 17, 2026 in 1m 12s

Gitzilla review complete

No actionable issues found.

After analyzing this PR thoroughly, I find no actionable defects. The changes are:

  1. Database cleanup now uses shared connection pool: The DatabaseCleanup struct now accepts Arc<PriceDatabase> in its constructor and uses self.database.get_connection() to obtain pooled connections instead of opening its own DATABASE_PATH directly. This improves resource management and concurrency handling.

  2. Error logging in aggregation: The aggregate_buckets function now uses warn! to log failures when retrieving open/close prices from source buckets, falling back to avg_price instead of silently using the fallback value.

  3. Unused variable cleanup: The _effective_start variable was removed from health.rs (it computed if start_time > 0 { start_time } else { now } but was never used in the actual health check logic). The DATABASE_PATH import 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.