make sessions last two days

This commit is contained in:
codl 2017-07-30 13:05:27 +02:00
parent 165c632153
commit bc3def5152
1 changed files with 1 additions and 1 deletions

View File

@ -12,7 +12,7 @@ app = Celery('tasks', broker=flaskapp.config['CELERY_BROKER'], task_serializer='
@app.task
def remove_old_sessions():
Session.query.filter(Session.updated_at < (db.func.now() - timedelta(hours=12))).\
Session.query.filter(Session.updated_at < (db.func.now() - timedelta(hours=48))).\
delete(synchronize_session=False)
db.session.commit()