mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 741960 - Fuzz backoff times up to 25% more to avoid client lock-stepping. r=rnewman
This commit is contained in:
parent
f8dee3f4cb
commit
4d1ff3cc48
@ -226,6 +226,21 @@ public class SyncAdapter extends AbstractThreadedSyncAdapter implements GlobalSe
|
||||
return delayMilliseconds() > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Request that no sync start right away. A new sync won't start until
|
||||
* at least <code>backoff</code> milliseconds from now.
|
||||
*
|
||||
* @param backoff time to wait in milliseconds.
|
||||
*/
|
||||
@Override
|
||||
public void requestBackoff(long backoff) {
|
||||
if (backoff > 0) {
|
||||
// Fuzz the backoff time (up to 25% more) to prevent client lock-stepping; agrees with desktop.
|
||||
backoff = backoff + Math.round((double) backoff * 0.25d * Math.random());
|
||||
this.extendEarliestNextSync(System.currentTimeMillis() + backoff);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Asynchronously request an immediate sync, optionally syncing only the given
|
||||
* named stages.
|
||||
@ -530,13 +545,6 @@ public class SyncAdapter extends AbstractThreadedSyncAdapter implements GlobalSe
|
||||
Logger.trace(LOG_TAG, "Stage completed: " + currentState);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void requestBackoff(long backoff) {
|
||||
if (backoff > 0) {
|
||||
this.extendEarliestNextSync(System.currentTimeMillis() + backoff);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public synchronized String getAccountGUID() {
|
||||
String accountGUID = mAccountManager.getUserData(localAccount, Constants.ACCOUNT_GUID);
|
||||
|
Loading…
Reference in New Issue
Block a user