mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-08-01 23:36:08 -04:00
Clean up a bit. Add comment
This commit is contained in:
parent
fa90c180ee
commit
7ed2bbeb11
3 changed files with 18 additions and 26 deletions
|
@ -255,12 +255,13 @@ class SynapseHomeServer(HomeServer):
|
|||
quit_with_error(e.message)
|
||||
|
||||
def get_db_conn(self):
|
||||
db_conn = self.database_engine.module.connect(
|
||||
**{
|
||||
k: v for k, v in self.db_config.get("args", {}).items()
|
||||
if not k.startswith("cp_")
|
||||
}
|
||||
)
|
||||
# Any param beginning with cp_ is a parameter for adbapi, and should
|
||||
# not be passed to the database engine.
|
||||
db_params = {
|
||||
k: v for k, v in self.db_config.get("args", {}).items()
|
||||
if not k.startswith("cp_")
|
||||
}
|
||||
db_conn = self.database_engine.module.connect(**db_params)
|
||||
|
||||
self.database_engine.on_new_connection(db_conn)
|
||||
return db_conn
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue