mirror of https://github.com/M66B/FairEmail.git
Throttle send rate
This commit is contained in:
parent
a69123fc55
commit
285016124e
|
@ -138,6 +138,7 @@ public class ServiceSynchronize extends LifecycleService {
|
||||||
private static final long RECONNECT_BACKOFF = 60 * 1000L; // milliseconds
|
private static final long RECONNECT_BACKOFF = 60 * 1000L; // milliseconds
|
||||||
private static final int PREVIEW_SIZE = 250;
|
private static final int PREVIEW_SIZE = 250;
|
||||||
private static final int ACCOUNT_ERROR_AFTER = 60; // minutes
|
private static final int ACCOUNT_ERROR_AFTER = 60; // minutes
|
||||||
|
private static final int SEND_WAIT = 90; // seconds
|
||||||
|
|
||||||
static final int PI_WHY = 1;
|
static final int PI_WHY = 1;
|
||||||
static final int PI_CLEAR = 2;
|
static final int PI_CLEAR = 2;
|
||||||
|
@ -1557,6 +1558,13 @@ public class ServiceSynchronize extends LifecycleService {
|
||||||
}
|
}
|
||||||
|
|
||||||
EntityOperation.process(this);
|
EntityOperation.process(this);
|
||||||
|
|
||||||
|
// Throttle send rate
|
||||||
|
try {
|
||||||
|
Thread.sleep(SEND_WAIT * 60 * 1000L);
|
||||||
|
} catch (InterruptedException ignored) {
|
||||||
|
}
|
||||||
|
|
||||||
} catch (MessagingException ex) {
|
} catch (MessagingException ex) {
|
||||||
db.identity().setIdentityError(ident.id, Helper.formatThrowable(ex));
|
db.identity().setIdentityError(ident.id, Helper.formatThrowable(ex));
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue