Support multiple retries for getUserProfilePhotos.

This commit is contained in:
levlam 2023-03-15 13:51:35 +03:00
parent 1153e5464d
commit 56a93292bb
2 changed files with 2 additions and 1 deletions

View File

@ -16201,7 +16201,7 @@ void ContactsManager::on_get_user_profile_photos(UserId user_id, Result<Unit> &&
continue; continue;
} }
if (request_index == 0) { if (request_index == 0 && ++request.retry_count == 3) {
request.promise.set_error(Status::Error(500, "Failed to get profile photos")); request.promise.set_error(Status::Error(500, "Failed to get profile photos"));
continue; continue;
} }

View File

@ -1083,6 +1083,7 @@ class ContactsManager final : public Actor {
struct PendingGetPhotoRequest { struct PendingGetPhotoRequest {
int32 offset = 0; int32 offset = 0;
int32 limit = 0; int32 limit = 0;
int32 retry_count = 0;
Promise<td_api::object_ptr<td_api::chatPhotos>> promise; Promise<td_api::object_ptr<td_api::chatPhotos>> promise;
}; };