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
d43d480d
Commit
d43d480d
authored
6 years ago
by
Richard van der Hoff
Browse files
Options
Downloads
Patches
Plain Diff
Remove unused `update_external_syncs`
This method isn't used anywhere. Burninate it.
parent
f8a1e76d
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
synapse/handlers/presence.py
+0
-55
0 additions, 55 deletions
synapse/handlers/presence.py
with
0 additions
and
55 deletions
synapse/handlers/presence.py
+
0
−
55
View file @
d43d480d
...
@@ -463,61 +463,6 @@ class PresenceHandler(object):
...
@@ -463,61 +463,6 @@ class PresenceHandler(object):
syncing_user_ids
.
update
(
user_ids
)
syncing_user_ids
.
update
(
user_ids
)
return
syncing_user_ids
return
syncing_user_ids
@defer.inlineCallbacks
def
update_external_syncs
(
self
,
process_id
,
syncing_user_ids
):
"""
Update the syncing users for an external process
Args:
process_id(str): An identifier for the process the users are
syncing against. This allows synapse to process updates
as user start and stop syncing against a given process.
syncing_user_ids(set(str)): The set of user_ids that are
currently syncing on that server.
"""
# Grab the previous list of user_ids that were syncing on that process
prev_syncing_user_ids
=
(
self
.
external_process_to_current_syncs
.
get
(
process_id
,
set
())
)
# Grab the current presence state for both the users that are syncing
# now and the users that were syncing before this update.
prev_states
=
yield
self
.
current_state_for_users
(
syncing_user_ids
|
prev_syncing_user_ids
)
updates
=
[]
time_now_ms
=
self
.
clock
.
time_msec
()
# For each new user that is syncing check if we need to mark them as
# being online.
for
new_user_id
in
syncing_user_ids
-
prev_syncing_user_ids
:
prev_state
=
prev_states
[
new_user_id
]
if
prev_state
.
state
==
PresenceState
.
OFFLINE
:
updates
.
append
(
prev_state
.
copy_and_replace
(
state
=
PresenceState
.
ONLINE
,
last_active_ts
=
time_now_ms
,
last_user_sync_ts
=
time_now_ms
,
))
else
:
updates
.
append
(
prev_state
.
copy_and_replace
(
last_user_sync_ts
=
time_now_ms
,
))
# For each user that is still syncing or stopped syncing update the
# last sync time so that we will correctly apply the grace period when
# they stop syncing.
for
old_user_id
in
prev_syncing_user_ids
:
prev_state
=
prev_states
[
old_user_id
]
updates
.
append
(
prev_state
.
copy_and_replace
(
last_user_sync_ts
=
time_now_ms
,
))
yield
self
.
_update_states
(
updates
)
# Update the last updated time for the process. We expire the entries
# if we don't receive an update in the given timeframe.
self
.
external_process_last_updated_ms
[
process_id
]
=
self
.
clock
.
time_msec
()
self
.
external_process_to_current_syncs
[
process_id
]
=
syncing_user_ids
@defer.inlineCallbacks
@defer.inlineCallbacks
def
update_external_syncs_row
(
self
,
process_id
,
user_id
,
is_syncing
,
sync_time_msec
):
def
update_external_syncs_row
(
self
,
process_id
,
user_id
,
is_syncing
,
sync_time_msec
):
"""
Update the syncing users for an external process as a delta.
"""
Update the syncing users for an external process as a delta.
...
...
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