server: Only hook the lazy hook if it isn't already hooked.
This commit is contained in:
parent
ccb263977a
commit
53b514809c
1 changed files with 4 additions and 6 deletions
|
@ -852,8 +852,6 @@ class MatrixServer(object):
|
||||||
room_buffer = self.find_room_from_id(room_id)
|
room_buffer = self.find_room_from_id(room_id)
|
||||||
room_buffer.handle_left_room(info)
|
room_buffer.handle_left_room(info)
|
||||||
|
|
||||||
should_lazy_hook = False
|
|
||||||
|
|
||||||
for room_id, info in response.rooms.join.items():
|
for room_id, info in response.rooms.join.items():
|
||||||
if room_id not in self.buffers:
|
if room_id not in self.buffers:
|
||||||
self.create_room_buffer(room_id, info.timeline.prev_batch)
|
self.create_room_buffer(room_id, info.timeline.prev_batch)
|
||||||
|
@ -861,7 +859,6 @@ class MatrixServer(object):
|
||||||
room_buffer = self.find_room_from_id(room_id)
|
room_buffer = self.find_room_from_id(room_id)
|
||||||
room_buffer.handle_joined_room(info)
|
room_buffer.handle_joined_room(info)
|
||||||
|
|
||||||
|
|
||||||
def add_unhandled_users(self, rooms, n):
|
def add_unhandled_users(self, rooms, n):
|
||||||
# type: (List[RoomBuffer], int) -> bool
|
# type: (List[RoomBuffer], int) -> bool
|
||||||
total_users = 0
|
total_users = 0
|
||||||
|
@ -912,8 +909,9 @@ class MatrixServer(object):
|
||||||
|
|
||||||
for room_buffer in self.room_buffers.values():
|
for room_buffer in self.room_buffers.values():
|
||||||
if room_buffer.unhandled_users:
|
if room_buffer.unhandled_users:
|
||||||
hook = W.hook_timer(1 * 100, 0, 0, "matrix_load_users_cb",
|
if not self.lazy_load_hook:
|
||||||
self.name)
|
hook = W.hook_timer(1 * 1000, 0, 0,
|
||||||
|
"matrix_load_users_cb", self.name)
|
||||||
self.lazy_load_hook = hook
|
self.lazy_load_hook = hook
|
||||||
break
|
break
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue