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: