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:
@@ -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()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user