loop: disable autocommits, reset db session on looping
This commit is contained in:
@@ -37,7 +37,9 @@ def main():
|
||||
sql_session = Session(
|
||||
engine,
|
||||
expire_on_commit=False,
|
||||
autocommit=False,
|
||||
autoflush=False,
|
||||
close_resets_only=True,
|
||||
)
|
||||
|
||||
if args.subcommand == "loop":
|
||||
|
||||
@@ -108,3 +108,4 @@ def main(sql_session: Session):
|
||||
else:
|
||||
break
|
||||
print("Restarting main menu.")
|
||||
main_menu.sql_session.reset()
|
||||
|
||||
Reference in New Issue
Block a user