Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
synapse
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Monitor
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Maunium
synapse
Commits
9c712a36
Commit
9c712a36
authored
8 years ago
by
Erik Johnston
Browse files
Options
Downloads
Patches
Plain Diff
Move get_presence_list_* to SlaveStore
parent
a8c8e4ef
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
synapse/app/federation_sender.py
+2
-13
2 additions, 13 deletions
synapse/app/federation_sender.py
synapse/app/synchrotron.py
+1
-11
1 addition, 11 deletions
synapse/app/synchrotron.py
synapse/replication/slave/storage/presence.py
+10
-0
10 additions, 0 deletions
synapse/replication/slave/storage/presence.py
with
13 additions
and
24 deletions
synapse/app/federation_sender.py
+
2
−
13
View file @
9c712a36
...
@@ -28,11 +28,11 @@ from synapse.replication.slave.storage.deviceinbox import SlavedDeviceInboxStore
...
@@ -28,11 +28,11 @@ from synapse.replication.slave.storage.deviceinbox import SlavedDeviceInboxStore
from
synapse.replication.slave.storage.events
import
SlavedEventStore
from
synapse.replication.slave.storage.events
import
SlavedEventStore
from
synapse.replication.slave.storage.receipts
import
SlavedReceiptsStore
from
synapse.replication.slave.storage.receipts
import
SlavedReceiptsStore
from
synapse.replication.slave.storage.registration
import
SlavedRegistrationStore
from
synapse.replication.slave.storage.registration
import
SlavedRegistrationStore
from
synapse.replication.slave.storage.presence
import
SlavedPresenceStore
from
synapse.replication.slave.storage.transactions
import
TransactionStore
from
synapse.replication.slave.storage.transactions
import
TransactionStore
from
synapse.replication.slave.storage.devices
import
SlavedDeviceStore
from
synapse.replication.slave.storage.devices
import
SlavedDeviceStore
from
synapse.replication.tcp.client
import
ReplicationClientHandler
from
synapse.replication.tcp.client
import
ReplicationClientHandler
from
synapse.storage.engines
import
create_engine
from
synapse.storage.engines
import
create_engine
from
synapse.storage.presence
import
PresenceStore
from
synapse.util.async
import
Linearizer
from
synapse.util.async
import
Linearizer
from
synapse.util.httpresourcetree
import
create_resource_tree
from
synapse.util.httpresourcetree
import
create_resource_tree
from
synapse.util.logcontext
import
LoggingContext
,
PreserveLoggingContext
,
preserve_fn
from
synapse.util.logcontext
import
LoggingContext
,
PreserveLoggingContext
,
preserve_fn
...
@@ -56,7 +56,7 @@ logger = logging.getLogger("synapse.app.appservice")
...
@@ -56,7 +56,7 @@ logger = logging.getLogger("synapse.app.appservice")
class
FederationSenderSlaveStore
(
class
FederationSenderSlaveStore
(
SlavedDeviceInboxStore
,
TransactionStore
,
SlavedReceiptsStore
,
SlavedEventStore
,
SlavedDeviceInboxStore
,
TransactionStore
,
SlavedReceiptsStore
,
SlavedEventStore
,
SlavedRegistrationStore
,
SlavedDeviceStore
,
SlavedRegistrationStore
,
SlavedDeviceStore
,
SlavedPresenceStore
,
):
):
def
__init__
(
self
,
db_conn
,
hs
):
def
__init__
(
self
,
db_conn
,
hs
):
super
(
FederationSenderSlaveStore
,
self
).
__init__
(
db_conn
,
hs
)
super
(
FederationSenderSlaveStore
,
self
).
__init__
(
db_conn
,
hs
)
...
@@ -81,17 +81,6 @@ class FederationSenderSlaveStore(
...
@@ -81,17 +81,6 @@ class FederationSenderSlaveStore(
return
rows
[
0
][
0
]
if
rows
else
-
1
return
rows
[
0
][
0
]
if
rows
else
-
1
# XXX: This is a bit broken because we don't persist the accepted list in a
# way that can be replicated. This means that we don't have a way to
# invalidate the cache correctly.
# This is fine since in practice nobody uses the presence list stuff...
get_presence_list_accepted
=
PresenceStore
.
__dict__
[
"
get_presence_list_accepted
"
]
get_presence_list_observers_accepted
=
PresenceStore
.
__dict__
[
"
get_presence_list_observers_accepted
"
]
class
FederationSenderServer
(
HomeServer
):
class
FederationSenderServer
(
HomeServer
):
def
get_db_conn
(
self
,
run_new_connection
=
True
):
def
get_db_conn
(
self
,
run_new_connection
=
True
):
...
...
This diff is collapsed.
Click to expand it.
synapse/app/synchrotron.py
+
1
−
11
View file @
9c712a36
...
@@ -44,7 +44,7 @@ from synapse.replication.tcp.client import ReplicationClientHandler
...
@@ -44,7 +44,7 @@ from synapse.replication.tcp.client import ReplicationClientHandler
from
synapse.server
import
HomeServer
from
synapse.server
import
HomeServer
from
synapse.storage.client_ips
import
ClientIpStore
from
synapse.storage.client_ips
import
ClientIpStore
from
synapse.storage.engines
import
create_engine
from
synapse.storage.engines
import
create_engine
from
synapse.storage.presence
import
PresenceStore
,
UserPresenceState
from
synapse.storage.presence
import
UserPresenceState
from
synapse.storage.roommember
import
RoomMemberStore
from
synapse.storage.roommember
import
RoomMemberStore
from
synapse.util.httpresourcetree
import
create_resource_tree
from
synapse.util.httpresourcetree
import
create_resource_tree
from
synapse.util.logcontext
import
LoggingContext
,
PreserveLoggingContext
,
preserve_fn
from
synapse.util.logcontext
import
LoggingContext
,
PreserveLoggingContext
,
preserve_fn
...
@@ -89,16 +89,6 @@ class SynchrotronSlavedStore(
...
@@ -89,16 +89,6 @@ class SynchrotronSlavedStore(
RoomMemberStore
.
__dict__
[
"
did_forget
"
]
RoomMemberStore
.
__dict__
[
"
did_forget
"
]
)
)
# XXX: This is a bit broken because we don't persist the accepted list in a
# way that can be replicated. This means that we don't have a way to
# invalidate the cache correctly.
get_presence_list_accepted
=
PresenceStore
.
__dict__
[
"
get_presence_list_accepted
"
]
get_presence_list_observers_accepted
=
PresenceStore
.
__dict__
[
"
get_presence_list_observers_accepted
"
]
UPDATE_SYNCING_USERS_MS
=
10
*
1000
UPDATE_SYNCING_USERS_MS
=
10
*
1000
...
...
This diff is collapsed.
Click to expand it.
synapse/replication/slave/storage/presence.py
+
10
−
0
View file @
9c712a36
...
@@ -39,6 +39,16 @@ class SlavedPresenceStore(BaseSlavedStore):
...
@@ -39,6 +39,16 @@ class SlavedPresenceStore(BaseSlavedStore):
_get_presence_for_user
=
PresenceStore
.
__dict__
[
"
_get_presence_for_user
"
]
_get_presence_for_user
=
PresenceStore
.
__dict__
[
"
_get_presence_for_user
"
]
get_presence_for_users
=
PresenceStore
.
__dict__
[
"
get_presence_for_users
"
]
get_presence_for_users
=
PresenceStore
.
__dict__
[
"
get_presence_for_users
"
]
# XXX: This is a bit broken because we don't persist the accepted list in a
# way that can be replicated. This means that we don't have a way to
# invalidate the cache correctly.
get_presence_list_accepted
=
PresenceStore
.
__dict__
[
"
get_presence_list_accepted
"
]
get_presence_list_observers_accepted
=
PresenceStore
.
__dict__
[
"
get_presence_list_observers_accepted
"
]
def
get_current_presence_token
(
self
):
def
get_current_presence_token
(
self
):
return
self
.
_presence_id_gen
.
get_current_token
()
return
self
.
_presence_id_gen
.
get_current_token
()
...
...
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