Conversation
- SchedulerService: APScheduler-based background scheduler with singleton pattern - Auto-run portfolios on configured cadence (daily/weekly/monthly) - Auto-apply trades or queue as pending based on per-portfolio setting - Persist scheduler state to data/state/scheduler.json - UI: scheduling controls in portfolio detail + dashboard status - New model fields: scheduler_enabled, auto_apply_trades - Robust error handling with logging - Handle empty state JSON files gracefully - 7 unit tests for scheduler service
Technical Review of PR #6 - Scheduled ExecutionAssumption: PR #6 compares 🚨 Critical Issues Found1. Singleton conflicts with
|
|
File "...fin_trade\pages\dashboard.py", line 144, in render_dashboard_page |
Changes
SchedulerService (
src/fin_trade/services/scheduler.py) — 425 linesdata/state/scheduler.json(enabled portfolios, last run times)Model Changes
PortfolioConfig: addedscheduler_enabled: boolandauto_apply_trades: boolPortfolioService: addedsave_config()method, empty state file guardUI
Tests (
tests/test_scheduler.py) — 7 tests+895 lines across 11 files