Throttle send rate

pull/146/head
M66B 6 years ago
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 int PREVIEW_SIZE = 250;
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_CLEAR = 2;
@ -1557,6 +1558,13 @@ public class ServiceSynchronize extends LifecycleService {
}
EntityOperation.process(this);
// Throttle send rate
try {
Thread.sleep(SEND_WAIT * 60 * 1000L);
} catch (InterruptedException ignored) {
}
} catch (MessagingException ex) {
db.identity().setIdentityError(ident.id, Helper.formatThrowable(ex));

Loading…
Cancel
Save