diff --git a/app/routers/main.py b/app/routers/main.py index 545d6dc..7e285fb 100644 --- a/app/routers/main.py +++ b/app/routers/main.py @@ -38,12 +38,12 @@ def update_all_customer_fuel_levels(): It should be called once per day by a cron job or scheduler. """ try: - estimator = FuelEstimator() + estimator = FuelEstimator(session) result = estimator.run_daily_update() + session.commit() return result except Exception as e: session.rollback() # Log the exception e + print(str(e)) return {"ok": False, "message": "An internal error occurred."} - -