Migrate exchange app to centralized aitbc package utilities

- Migrate 2 files from logging to aitbc.get_logger
- health_monitor.py, real_exchange_integration.py
- Remove logging.basicConfig() from both files
- Migrate 3 files with hardcoded paths to use DATA_DIR constant
- simple_exchange_api.py, scripts/seed_market.py, database.py
This commit is contained in:
aitbc
2026-04-25 07:12:27 +02:00
parent 10a0752732
commit a58773d4d4
5 changed files with 11 additions and 11 deletions

View File

@@ -3,12 +3,13 @@
import sqlite3
from datetime import datetime
from aitbc.constants import DATA_DIR
def seed_initial_price():
"""Create initial trades to establish market price"""
import os
db_path = os.getenv("EXCHANGE_DATABASE_URL", "sqlite:////var/lib/aitbc/data/exchange/exchange.db").replace("sqlite:///", "")
db_path = os.getenv("EXCHANGE_DATABASE_URL", f"sqlite:///{DATA_DIR}/data/exchange/exchange.db").replace("sqlite://///", "")
conn = sqlite3.connect(db_path)
cursor = conn.cursor()