From a88fb1045522a60cff6405f4ec5426249a4bb3f1 Mon Sep 17 00:00:00 2001 From: Aevann Date: Sat, 18 Mar 2023 15:11:30 +0200 Subject: [PATCH] restore autoflush --- files/__main__.py | 2 +- files/helpers/media.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/files/__main__.py b/files/__main__.py index 2dcb72625..52f7576d1 100644 --- a/files/__main__.py +++ b/files/__main__.py @@ -74,7 +74,7 @@ limiter = Limiter( engine = create_engine(app.config['SQLALCHEMY_DATABASE_URL']) -db_session = scoped_session(sessionmaker(bind=engine, autoflush=False)) +db_session = scoped_session(sessionmaker(bind=engine)) const_initialize(db_session) diff --git a/files/helpers/media.py b/files/helpers/media.py index 4c8e52805..fddd058c3 100644 --- a/files/helpers/media.py +++ b/files/helpers/media.py @@ -150,7 +150,7 @@ def process_video(file, v): if extension not in {'mp4','avi','mkv'}: new = new.replace(f'.{extension}', '.mp4') copyfile(old, new) - db = Session(bind=g.db.get_bind(), autoflush=False) + db = Session(bind=g.db.get_bind()) gevent.spawn(convert_to_mp4, old, new, v.id, db) else: try: