Fixed commit bug in auto
This commit is contained in:
@@ -38,12 +38,12 @@ def update_all_customer_fuel_levels():
|
|||||||
It should be called once per day by a cron job or scheduler.
|
It should be called once per day by a cron job or scheduler.
|
||||||
"""
|
"""
|
||||||
try:
|
try:
|
||||||
estimator = FuelEstimator()
|
estimator = FuelEstimator(session)
|
||||||
result = estimator.run_daily_update()
|
result = estimator.run_daily_update()
|
||||||
|
session.commit()
|
||||||
return result
|
return result
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
session.rollback()
|
session.rollback()
|
||||||
# Log the exception e
|
# Log the exception e
|
||||||
|
print(str(e))
|
||||||
return {"ok": False, "message": "An internal error occurred."}
|
return {"ok": False, "message": "An internal error occurred."}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user