make sessions last two days
This commit is contained in:
parent
165c632153
commit
bc3def5152
2
tasks.py
2
tasks.py
|
@ -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()
|
||||
|
||||
|
|
Loading…
Reference in New Issue