Set alchemysession core mode on by default
Bump minimum telethon-session-sqlalchemy version for core mode support on non-postgres engines Fixes #263
This commit is contained in:
@@ -27,9 +27,6 @@ appservice:
|
||||
# SQLite: sqlite:///filename.db
|
||||
# Postgres: postgres://username:password@hostname/dbname
|
||||
database: sqlite:///mautrix-telegram.db
|
||||
# Whether or not to use SQLAlchemy Core for common database actions. Use if the bridge is
|
||||
# being bottlenecked on ORM commits. Only supported with PostgreSQL.
|
||||
sqlalchemy_core_mode: false
|
||||
|
||||
# Public part of web server for out-of-Matrix interaction with the bridge.
|
||||
# Used for things like login if the user wants to make sure the 2FA password isn't stored in
|
||||
|
||||
@@ -79,11 +79,7 @@ Base.metadata.bind = db_engine
|
||||
session_container = AlchemySessionContainer(engine=db_engine, session=db_session,
|
||||
table_base=Base, table_prefix="telethon_",
|
||||
manage_tables=False)
|
||||
if config["appservice.sqlalchemy_core_mode"]:
|
||||
try:
|
||||
session_container.core_mode = True
|
||||
except AttributeError:
|
||||
log.error("Current version of teleton-session-sqlalchemy does not support core mode")
|
||||
session_container.core_mode = True
|
||||
|
||||
loop = asyncio.get_event_loop() # type: asyncio.AbstractEventLoop
|
||||
|
||||
|
||||
@@ -165,7 +165,6 @@ class Config(DictWithRecursion):
|
||||
copy("appservice.max_body_size")
|
||||
|
||||
copy("appservice.database")
|
||||
copy("appservice.sqlalchemy_core_mode")
|
||||
|
||||
copy("appservice.public.enabled")
|
||||
copy("appservice.public.prefix")
|
||||
|
||||
Reference in New Issue
Block a user