05/31 Phase 4

This commit is contained in:
2026-05-31 16:40:59 -04:00
parent 1560041cdb
commit 9c846159ef
9 changed files with 925 additions and 1 deletions
+25
View File
@@ -0,0 +1,25 @@
#!/usr/bin/env python3
"""
Cron script: update investment prices via yfinance.
Run by systemd timer pfm-prices.timer at 4PM weekdays.
"""
import sys
import os
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from app import create_app
from app.services.investment_service import update_prices
app = create_app()
if __name__ == '__main__':
with app.app_context():
print('[fetch_prices] Starting price update...')
updated = update_prices()
if updated:
for ticker, price in updated.items():
print(f' {ticker}: {price:.4f}')
print(f'[fetch_prices] Updated {len(updated)} ticker(s).')
else:
print('[fetch_prices] No tickers updated.')