trainmenow / trainback

Backend of trainmenow created with Flask, MySQL and MongoDB.
0 stars 0 forks source link

flask-sqlalchemy session time out after 1 day #18

Open MaximilianKromer opened 4 years ago

MaximilianKromer commented 4 years ago

restart server restarts session

MaximilianKromer commented 4 years ago

Error: sqlalchemy.exc.OperationalError: (pymysql.err.OperationalError) (2006, "MySQL server has gone away (TimeoutError(110, 'Connection timed out'))")

Search result:

leads to looking for 'SQLALCHEMY_POOL_PRE_PING':

MaximilianKromer commented 4 years ago

Fix: add app.config['SQLALCHEMY_ENGINE_OPTIONS'] = {'pool_size' : 100, 'pool_recycle' : 280}` to app configuration

MaximilianKromer commented 4 years ago

Configuration for pythonanywhere.com: