gotd/tgerr: reduce default flood wait max duration

This commit is contained in:
Tulir Asokan
2026-04-08 00:41:12 +03:00
parent cc32d48fea
commit 60e3cf9c01
2 changed files with 4 additions and 2 deletions
+3 -1
View File
@@ -102,9 +102,11 @@ func (tc *TelegramClient) syncChats(ctx context.Context, takeoutID int64, onLogi
dialogs, err := APICallWithUpdates(ctx, tc, func() (tg.ModifiedMessagesDialogs, error) {
var dialogs tg.MessagesDialogsBox
retry := true
attempts := 0
var err error
for retry {
for retry && attempts < 5 {
retry, err = tgerr.FloodWait(ctx, tc.client.Invoke(ctx, wrappedReq, &dialogs))
attempts++
}
if err != nil {
return nil, err