1
0
mirror of https://github.com/fabianonline/telegram_backup.git synced 2024-11-23 01:06:17 +00:00

Experiment: Randomize the number of requested messages.

This commit is contained in:
Fabian Schlenz 2017-02-14 06:45:38 +01:00
parent ec0c05fdb8
commit e9df4ebdb4

View File

@ -173,7 +173,9 @@ public class DownloadManager {
while (ids.size()>0) { while (ids.size()>0) {
logger.trace("Loop"); logger.trace("Loop");
TLIntVector vector = new TLIntVector(); TLIntVector vector = new TLIntVector();
for (int i=0; i<Config.GET_MESSAGES_BATCH_SIZE; i++) { int download_count = Config.GET_MESSAGES_BATCH_SIZE - (int)(Math.random() * Config.GET_MESSAGES_BATCH_SIZE * 0.2);
logger.trace("download_count: {}", download_count);
for (int i=0; i<download_count; i++) {
if (ids.size()==0) break; if (ids.size()==0) break;
vector.add(ids.remove(0)); vector.add(ids.remove(0));
} }