Refresh data outside of main because flask loads this script in production

This commit is contained in:
Jackson Harper
2024-07-01 16:12:33 +08:00
parent 08c884b793
commit a5a4974de9

View File

@ -215,6 +215,8 @@ def batch():
app.logger.error(f"exception in batch endpoint: {request.get_json()}\n{e}")
return jsonify({'error': str(e)}), 500
## Run this on startup in both production and development modes
refresh_data()
if __name__ == '__main__':
refresh_data()
app.run(debug=True, port=5000)