Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
facebook
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Container Registry
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
mautrix
facebook
Commits
1b3b5d9a
Commit
1b3b5d9a
authored
4 years ago
by
Tulir Asokan
Browse files
Options
Downloads
Patches
Plain Diff
Add db connection pool size config options
parent
23fadda5
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
mautrix_facebook/__main__.py
+3
-1
3 additions, 1 deletion
mautrix_facebook/__main__.py
mautrix_facebook/example-config.yaml
+5
-0
5 additions, 0 deletions
mautrix_facebook/example-config.yaml
mautrix_facebook/puppet.py
+1
-1
1 addition, 1 deletion
mautrix_facebook/puppet.py
with
9 additions
and
2 deletions
mautrix_facebook/__main__.py
+
3
−
1
View file @
1b3b5d9a
...
...
@@ -56,7 +56,7 @@ class MessengerBridge(Bridge):
def
prepare_db
(
self
)
->
None
:
self
.
db
=
Database
(
self
.
config
[
"
appservice.database
"
],
upgrade_table
=
upgrade_table
,
loop
=
self
.
loop
)
loop
=
self
.
loop
,
db_args
=
self
.
config
[
"
appservice.database_opts
"
]
)
init_db
(
self
.
db
)
def
prepare_bridge
(
self
)
->
None
:
...
...
@@ -83,6 +83,8 @@ class MessengerBridge(Bridge):
async
def
start
(
self
)
->
None
:
await
self
.
db
.
start
()
await
self
.
state_store
.
upgrade_table
.
upgrade
(
self
.
db
.
pool
)
if
self
.
matrix
.
e2ee
:
self
.
matrix
.
e2ee
.
crypto_db
.
override_pool
(
self
.
db
.
pool
)
self
.
add_startup_actions
(
User
.
init_cls
(
self
))
self
.
add_startup_actions
(
Puppet
.
init_cls
(
self
))
Portal
.
init_cls
(
self
)
...
...
This diff is collapsed.
Click to expand it.
mautrix_facebook/example-config.yaml
+
5
−
0
View file @
1b3b5d9a
...
...
@@ -27,6 +27,11 @@ appservice:
# The full URI to the database. Only Postgres is currently supported.
database
:
postgres://username:password@hostname/db
# Additional arguments for asyncpg.create_pool()
# https://magicstack.github.io/asyncpg/current/api/index.html#asyncpg.pool.create_pool
database_opts
:
min_size
:
5
max_size
:
10
# Public part of web server for out-of-Matrix interaction with the bridge.
public
:
...
...
This diff is collapsed.
Click to expand it.
mautrix_facebook/puppet.py
+
1
−
1
View file @
1b3b5d9a
...
...
@@ -227,7 +227,7 @@ class Puppet(DBPuppet, BasePuppet):
async
def
get_by_mxid
(
cls
,
mxid
:
UserID
,
create
:
bool
=
True
)
->
Optional
[
'
Puppet
'
]:
fbid
=
cls
.
get_id_from_mxid
(
mxid
)
if
fbid
:
return
await
cls
.
get_by_fbid
(
fbid
,
create
)
return
await
cls
.
get_by_fbid
(
fbid
,
create
=
create
)
return
None
@classmethod
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment