comment #261 - Increase delay to avoid error 421

This commit is contained in:
tom79 2019-10-20 16:21:04 +02:00
parent b1acb843dc
commit b318a9b106
3 changed files with 17 additions and 3 deletions

View File

@ -44,6 +44,8 @@ import app.fedilab.android.sqlite.NotificationCacheDAO;
import app.fedilab.android.sqlite.Sqlite;
import es.dmoral.toasty.Toasty;
import static app.fedilab.android.helper.Helper.sleeps;
/**
* Created by Thomas on 24/08/2019.
@ -138,7 +140,11 @@ public class BackupNotificationInDataBaseService extends IntentService {
new NotificationCacheDAO(BackupNotificationInDataBaseService.this, db).insertNotification(tmpNotification, userId, instance);
backupNotifications.add(tmpNotification);
}
SystemClock.sleep(500);
try {
Thread.sleep(2000);
} catch (InterruptedException e) {
SystemClock.sleep(2000);
}
} while (max_id != null && canContinue);
if (backupNotifications.size() > 0) {

View File

@ -138,7 +138,11 @@ public class BackupStatusInDataBaseService extends IntentService {
new StatusCacheDAO(BackupStatusInDataBaseService.this, db).insertStatus(StatusCacheDAO.ARCHIVE_CACHE, tmpStatus, userId, instance);
backupStatus.add(tmpStatus);
}
SystemClock.sleep(500);
try {
Thread.sleep(2000);
} catch (InterruptedException e) {
SystemClock.sleep(2000);
}
} while (max_id != null && canContinue);
if (backupStatus.size() > 0) {

View File

@ -122,7 +122,11 @@ public class BackupStatusService extends IntentService {
List<Status> statuses = apiResponse.getStatuses();
if (statuses.size() > 0)
backupStatus.addAll(statuses);
SystemClock.sleep(500);
try {
Thread.sleep(2000);
} catch (InterruptedException e) {
SystemClock.sleep(2000);
}
} while (max_id != null);
String fileName = account.getAcct() + "@" + account.getInstance() + Helper.dateFileToString(getApplicationContext(), new Date()) + ".csv";