mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-31 01:34:22 -04:00
Local changes
This commit is contained in:
parent
cff886c47b
commit
8d910ff5b9
7 changed files with 16 additions and 7 deletions
|
@ -327,7 +327,7 @@ class DeviceHandler(BaseHandler):
|
|||
user_id
|
||||
)
|
||||
logger.info("Extrem: %r, prev_ids: %r", extremity, prev_ids)
|
||||
if str(extremity) == str(prev_ids[0]):
|
||||
if extremity and prev_ids[0] and int(extremity) >= int(prev_ids[0]):
|
||||
resync = False
|
||||
|
||||
if resync:
|
||||
|
|
|
@ -363,6 +363,7 @@ class InitialSyncHandler(BaseHandler):
|
|||
|
||||
@defer.inlineCallbacks
|
||||
def get_presence():
|
||||
defer.returnValue([])
|
||||
states = yield presence_handler.get_states(
|
||||
[m.user_id for m in room_members],
|
||||
as_event=True,
|
||||
|
|
|
@ -373,6 +373,7 @@ class PresenceHandler(object):
|
|||
"""We've seen the user do something that indicates they're interacting
|
||||
with the app.
|
||||
"""
|
||||
return
|
||||
user_id = user.to_string()
|
||||
|
||||
bump_active_time_counter.inc()
|
||||
|
@ -402,6 +403,7 @@ class PresenceHandler(object):
|
|||
Useful for streams that are not associated with an actual
|
||||
client that is being used by a user.
|
||||
"""
|
||||
affect_presence = False
|
||||
if affect_presence:
|
||||
curr_sync = self.user_to_num_current_syncs.get(user_id, 0)
|
||||
self.user_to_num_current_syncs[user_id] = curr_sync + 1
|
||||
|
@ -463,6 +465,7 @@ class PresenceHandler(object):
|
|||
syncing_user_ids(set(str)): The set of user_ids that are
|
||||
currently syncing on that server.
|
||||
"""
|
||||
return
|
||||
|
||||
# Grab the previous list of user_ids that were syncing on that process
|
||||
prev_syncing_user_ids = (
|
||||
|
|
|
@ -539,7 +539,7 @@ class SyncHandler(object):
|
|||
since_token is None and
|
||||
sync_config.filter_collection.blocks_all_presence()
|
||||
)
|
||||
if not block_all_presence_data:
|
||||
if False or not block_all_presence_data:
|
||||
yield self._generate_sync_entry_for_presence(
|
||||
sync_result_builder, newly_joined_rooms, newly_joined_users
|
||||
)
|
||||
|
|
|
@ -218,7 +218,8 @@ class EmailPusher(object):
|
|||
)
|
||||
|
||||
def seconds_until(self, ts_msec):
|
||||
return (ts_msec - self.clock.time_msec()) / 1000
|
||||
secs = (ts_msec - self.clock.time_msec()) / 1000
|
||||
return max(secs, 0) # Ensure non-negative
|
||||
|
||||
def get_room_throttle_ms(self, room_id):
|
||||
if room_id in self.throttle_params:
|
||||
|
|
|
@ -474,6 +474,7 @@ class RoomInitialSyncRestServlet(ClientV1RestServlet):
|
|||
|
||||
@defer.inlineCallbacks
|
||||
def on_GET(self, request, room_id):
|
||||
# raise RuntimeError("Guest access has been disabled")
|
||||
requester = yield self.auth.get_user_by_req(request, allow_guest=True)
|
||||
pagination_config = PaginationConfig.from_request(request)
|
||||
content = yield self.initial_sync_handler.room_initial_sync(
|
||||
|
|
|
@ -87,6 +87,8 @@ class EventPushActionsStore(SQLBaseStore):
|
|||
self._rotate_notif_loop = self._clock.looping_call(
|
||||
self._rotate_notifs, 30 * 60 * 1000
|
||||
)
|
||||
self._rotate_delay = 3
|
||||
self._rotate_count = 10000
|
||||
|
||||
def _set_push_actions_for_event_and_users_txn(self, txn, event, tuples):
|
||||
"""
|
||||
|
@ -629,7 +631,7 @@ class EventPushActionsStore(SQLBaseStore):
|
|||
)
|
||||
if caught_up:
|
||||
break
|
||||
yield sleep(5)
|
||||
yield sleep(self._rotate_delay)
|
||||
finally:
|
||||
self._doing_notif_rotation = False
|
||||
|
||||
|
@ -639,7 +641,7 @@ class EventPushActionsStore(SQLBaseStore):
|
|||
"""
|
||||
|
||||
# We want to make sure that we only ever do this one at a time
|
||||
self.database_engine.lock_table(txn, "event_push_summary")
|
||||
# self.database_engine.lock_table(txn, "event_push_summary")
|
||||
|
||||
old_rotate_stream_ordering = self._simple_select_one_onecol_txn(
|
||||
txn,
|
||||
|
@ -653,9 +655,10 @@ class EventPushActionsStore(SQLBaseStore):
|
|||
txn.execute("""
|
||||
SELECT stream_ordering FROM event_push_actions
|
||||
WHERE stream_ordering > ?
|
||||
ORDER BY stream_ordering ASC LIMIT 1 OFFSET 50000
|
||||
""", (old_rotate_stream_ordering,))
|
||||
ORDER BY stream_ordering ASC LIMIT 1 OFFSET ?
|
||||
""", (old_rotate_stream_ordering, self._rotate_count))
|
||||
stream_row = txn.fetchone()
|
||||
# stream_row = (old_rotate_stream_ordering + self._rotate_count,)
|
||||
if stream_row:
|
||||
offset_stream_ordering, = stream_row
|
||||
rotate_to_stream_ordering = min(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue