mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2024-12-26 21:59:24 -05:00
Fix unit tests
This commit is contained in:
parent
b58a8b1ee0
commit
82631c5f94
@ -629,7 +629,10 @@ class SyncHandler(BaseHandler):
|
|||||||
room_key = now_token.room_key
|
room_key = now_token.room_key
|
||||||
end_key = room_key
|
end_key = room_key
|
||||||
|
|
||||||
limited = recents is None or newly_joined_room or timeline_limit < len(recents)
|
if recents is None or newly_joined_room or timeline_limit < len(recents):
|
||||||
|
limited = True
|
||||||
|
else:
|
||||||
|
limited = False
|
||||||
|
|
||||||
if recents is not None:
|
if recents is not None:
|
||||||
recents = sync_config.filter_collection.filter_room_timeline(recents)
|
recents = sync_config.filter_collection.filter_room_timeline(recents)
|
||||||
|
@ -62,12 +62,13 @@ class Measure(object):
|
|||||||
def __enter__(self):
|
def __enter__(self):
|
||||||
self.start = self.clock.time_msec()
|
self.start = self.clock.time_msec()
|
||||||
self.start_context = LoggingContext.current_context()
|
self.start_context = LoggingContext.current_context()
|
||||||
self.ru_utime, self.ru_stime = self.start_context.get_resource_usage()
|
if self.start_context:
|
||||||
self.db_txn_count = self.start_context.db_txn_count
|
self.ru_utime, self.ru_stime = self.start_context.get_resource_usage()
|
||||||
self.db_txn_duration = self.start_context.db_txn_duration
|
self.db_txn_count = self.start_context.db_txn_count
|
||||||
|
self.db_txn_duration = self.start_context.db_txn_duration
|
||||||
|
|
||||||
def __exit__(self, exc_type, exc_val, exc_tb):
|
def __exit__(self, exc_type, exc_val, exc_tb):
|
||||||
if exc_type is not None:
|
if exc_type is not None or not self.start_context:
|
||||||
return
|
return
|
||||||
|
|
||||||
duration = self.clock.time_msec() - self.start
|
duration = self.clock.time_msec() - self.start
|
||||||
|
Loading…
Reference in New Issue
Block a user