OLD | NEW |
| (Empty) |
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. | |
4 | |
5 #include <stdint.h> | |
6 | |
7 #include "sync/internal_api/public/engine/polling_constants.h" | |
8 | |
9 namespace syncer { | |
10 | |
11 // Server can overwrite these values via client commands. | |
12 // Standard short poll. This is used when XMPP is off. | |
13 // We use high values here to ensure that failure to receive poll updates from | |
14 // the server doesn't result in rapid-fire polling from the client due to low | |
15 // local limits. | |
16 const int64_t kDefaultShortPollIntervalSeconds = 3600 * 8; | |
17 // Long poll is used when XMPP is on. | |
18 const int64_t kDefaultLongPollIntervalSeconds = 3600 * 12; | |
19 | |
20 // Maximum interval for exponential backoff. | |
21 const int64_t kMaxBackoffSeconds = 60 * 10; // 10 minutes. | |
22 | |
23 // Backoff interval randomization factor. | |
24 const int kBackoffRandomizationFactor = 2; | |
25 | |
26 // After a failure contacting sync servers, specifies how long to wait before | |
27 // reattempting and entering exponential backoff if consecutive failures | |
28 // occur. | |
29 const int kInitialBackoffRetrySeconds = 30; // 30 seconds. | |
30 | |
31 // A dangerously short retry value that would not actually protect servers from | |
32 // DDoS if it were used as a seed for exponential backoff, although the client | |
33 // would still follow exponential backoff. Useful for debugging and tests (when | |
34 // you don't want to wait 5 minutes). | |
35 const int kInitialBackoffShortRetrySeconds = 1; | |
36 | |
37 // Similar to kInitialBackoffRetrySeconds above, but only to be used in | |
38 // certain exceptional error cases, such as MIGRATION_DONE. | |
39 const int kInitialBackoffImmediateRetrySeconds = 0; | |
40 | |
41 } // namespace syncer | |
OLD | NEW |