Spaces:
Sleeping
Sleeping
File size: 596 Bytes
38ff36f d8a7674 38ff36f d8a7674 38ff36f | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | import os
import sys
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__))))
from app.db.base import SessionLocal
from app.api.admin import get_dashboard_stats, get_chart_data
def run():
db = SessionLocal()
try:
res1 = get_dashboard_stats(1, db)
print("Success stats:", res1)
res2 = get_chart_data(1, db)
print("Success charts:", len(res2["value"]), "days of data")
except Exception as e:
print("Error:", e)
finally:
db.close()
if __name__ == "__main__":
run()
|