Scale up as you grow — whether you're running one virtual machine or ten thousand.

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.

By yyz20002008
I have a flask app launched. however,the repeat function to update databse was not triggered. How can I let that function keep running backend and updating database? This is my code below.
My design was that I have a function to keep updating database , then webpage in flask app can show records in database. I am using APschedule to call function - “DataBaseUpdate”. However, it doesn’t run.
Someone told me create another non-web worker service in App platform. My questions are #1. update database, the worker service should connect internet, is non-web service will work? #2. Is the code base for this service independent than the flask-app? If so, can I use one dockerfile to deploy both this service and flask-app in future for convenience?
if __name__ == "__main__":
with app.app_context():
db.create_all() # <--- create db object.
start = datetime.date.today()+ datetime.timedelta(days=1) #set start and end time
end= start + datetime.timedelta(days=10)
scheduler = BackgroundScheduler()
scheduler.add_job(DataBaseUpdate, 'interval', seconds=30)
scheduler.start()
port = int(os.environ.get('PORT', 5000))
app.run(debug=True, host='0.0.0.0', port=port)
santoshpatil
crisdan
KFSys
Andrew J Montanus
nashurgessa
blueviolet
Ibrahim Mudassar
288dccdbfd934607b6f223b33b9d92
TinyLightSeaGreenShrimp
AdorableCeruleanEel
Bobby