forked from Mirrors/gomuks
hicli/init: add safety for too many empty rooms
This commit is contained in:
parent
e8c8a44f38
commit
2c489fa582
1 changed files with 4 additions and 1 deletions
|
@ -120,8 +120,11 @@ func (h *HiClient) GetInitialSync(ctx context.Context, batchSize int) iter.Seq[*
|
|||
payload := SyncComplete{
|
||||
Rooms: make(map[id.RoomID]*SyncRoom, len(rooms)),
|
||||
}
|
||||
for _, room := range rooms {
|
||||
for roomIdx, room := range rooms {
|
||||
if room.SortingTimestamp == rooms[len(rooms)-1].SortingTimestamp {
|
||||
if roomIdx == 0 {
|
||||
batchSize *= 2
|
||||
}
|
||||
break
|
||||
}
|
||||
maxTS = room.SortingTimestamp.Time
|
||||
|
|
Loading…
Add table
Reference in a new issue