1
0

hot fixes

This commit is contained in:
hera
2017-06-08 00:34:47 +00:00
parent 93ff41e845
commit fc51c7d833
6 changed files with 22 additions and 16 deletions
+17 -11
View File
@@ -176,17 +176,22 @@ class TransactionQueue(object):
if not is_mine and send_on_behalf_of is None:
continue
# Get the state from before the event.
# We need to make sure that this is the state from before
# the event and not from after it.
# Otherwise if the last member on a server in a room is
# banned then it won't receive the event because it won't
# be in the room after the ban.
destinations = yield self.state.get_current_hosts_in_room(
event.room_id, latest_event_ids=[
prev_id for prev_id, _ in event.prev_events
],
)
try:
# Get the state from before the event.
# We need to make sure that this is the state from before
# the event and not from after it.
# Otherwise if the last member on a server in a room is
# banned then it won't receive the event because it won't
# be in the room after the ban.
destinations = yield self.state.get_current_hosts_in_room(
event.room_id, latest_event_ids=[
prev_id for prev_id, _ in event.prev_events
],
)
except:
logger.exception("Failed to calculate hosts in room")
continue
destinations = set(destinations)
if send_on_behalf_of is not None:
@@ -246,6 +251,7 @@ class TransactionQueue(object):
Args:
states (list(UserPresenceState))
"""
return
# First we queue up the new presence by user ID, so multiple presence
# updates in quick successtion are correctly handled
+1
View File
@@ -99,6 +99,7 @@ class UserDirectoyHandler(object):
@defer.inlineCallbacks
def _unsafe_process(self):
return
# If self.pos is None then means we haven't fetched it from DB
if self.pos is None:
self.pos = yield self.store.get_user_directory_stream_pos()
+1 -1
View File
@@ -33,7 +33,7 @@ import logging
logger = logging.getLogger(__name__)
MAX_EVENTS_BEHIND = 10000
MAX_EVENTS_BEHIND = 500000
EventStreamRow = namedtuple("EventStreamRow", (
+1 -1
View File
@@ -184,7 +184,7 @@ class SQLBaseStore(object):
max_entries=hs.config.event_cache_size)
self._state_group_cache = DictionaryCache(
"*stateGroupCache*", 100000 * CACHE_SIZE_FACTOR
"*stateGroupCache*", 500000 * CACHE_SIZE_FACTOR
)
self._event_fetch_lock = threading.Condition()
+1 -1
View File
@@ -638,7 +638,7 @@ class RoomMemberStore(SQLBaseStore):
defer.returnValue(result)
@cached(max_entries=10000, iterable=True)
@cached(max_entries=10000)
def _get_joined_hosts_cache(self, room_id):
return _JoinedHostsCache(self, room_id)
+1 -2
View File
@@ -697,8 +697,7 @@ class StateStore(SQLBaseStore):
state_dict = results[group]
state_dict.update(
((intern_string(k[0]), intern_string(k[1])), to_ascii(v))
for k, v in group_state_dict.iteritems()
group_state_dict.iteritems()
)
self._state_group_cache.update(