1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "base/basictypes.h"
6 #include "sync/internal_api/public/engine/polling_constants.h"
10 // Server can overwrite these values via client commands.
11 // Standard short poll. This is used when XMPP is off.
12 // We use high values here to ensure that failure to receive poll updates from
13 // the server doesn't result in rapid-fire polling from the client due to low
15 const int64 kDefaultShortPollIntervalSeconds
= 3600 * 8;
16 // Long poll is used when XMPP is on.
17 const int64 kDefaultLongPollIntervalSeconds
= 3600 * 12;
19 // Maximum interval for exponential backoff.
20 const int64 kMaxBackoffSeconds
= 60 * 60 * 4; // 4 hours.
22 // Backoff interval randomization factor.
23 const int kBackoffRandomizationFactor
= 2;
25 // After a failure contacting sync servers, specifies how long to wait before
26 // reattempting and entering exponential backoff if consecutive failures
28 const int kInitialBackoffRetrySeconds
= 60 * 5; // 5 minutes.
30 // A dangerously short retry value that would not actually protect servers from
31 // DDoS if it were used as a seed for exponential backoff, although the client
32 // would still follow exponential backoff. Useful for debugging and tests (when
33 // you don't want to wait 5 minutes).
34 const int kInitialBackoffShortRetrySeconds
= 1;
36 // Similar to kInitialBackoffRetrySeconds above, but only to be used in
37 // certain exceptional error cases, such as MIGRATION_DONE.
38 const int kInitialBackoffImmediateRetrySeconds
= 0;