diff options
Diffstat (limited to 'sync')
-rw-r--r-- | sync/engine/sync_scheduler_impl.cc | 12 | ||||
-rw-r--r-- | sync/internal_api/public/util/syncer_error.h | 2 | ||||
-rw-r--r-- | sync/sessions/sync_session.cc | 7 | ||||
-rw-r--r-- | sync/sessions/sync_session.h | 6 |
4 files changed, 4 insertions, 23 deletions
diff --git a/sync/engine/sync_scheduler_impl.cc b/sync/engine/sync_scheduler_impl.cc index ef6ae6d..c30b78d 100644 --- a/sync/engine/sync_scheduler_impl.cc +++ b/sync/engine/sync_scheduler_impl.cc @@ -844,14 +844,10 @@ void SyncSchedulerImpl::ScheduleNextSync( AdjustPolling(finished_job.get()); if (succeeded) { - // Only reset backoff if we actually reached the server. - // It's possible that we reached the server on one attempt, then had an - // error on the next (or didn't perform some of the server-communicating - // commands). We want to verify that, for all commands attempted, we - // successfully spoke with the server. Therefore, we verify no errors - // and at least one SYNCER_OK. - if (finished_job->session()->DidReachServer()) - wait_interval_.reset(); + // No job currently supported by the scheduler could succeed without + // successfully reaching the server. Therefore, if we make it here, it is + // appropriate to reset the backoff interval. + wait_interval_.reset(); SDVLOG(2) << "Job succeeded so not scheduling more jobs"; return; } diff --git a/sync/internal_api/public/util/syncer_error.h b/sync/internal_api/public/util/syncer_error.h index 9711597..634d8e1d 100644 --- a/sync/internal_api/public/util/syncer_error.h +++ b/sync/internal_api/public/util/syncer_error.h @@ -29,8 +29,6 @@ enum SYNC_EXPORT_PRIVATE SyncerError { // Based on values returned by server. Most are defined in sync.proto. SERVER_RETURN_INVALID_CREDENTIAL, - FIRST_SERVER_RETURN_VALUE = SERVER_RETURN_INVALID_CREDENTIAL, - SERVER_RETURN_UNKNOWN_ERROR, SERVER_RETURN_THROTTLED, SERVER_RETURN_TRANSIENT_ERROR, diff --git a/sync/sessions/sync_session.cc b/sync/sessions/sync_session.cc index 11c95eb..b7ff433 100644 --- a/sync/sessions/sync_session.cc +++ b/sync/sessions/sync_session.cc @@ -75,12 +75,5 @@ void SyncSession::SendEventNotification(SyncEngineEvent::EventCause cause) { context()->NotifyListeners(event); } -bool SyncSession::DidReachServer() const { - const ModelNeutralState& state = status_controller_->model_neutral_state(); - return state.last_get_key_result >= FIRST_SERVER_RETURN_VALUE || - state.last_download_updates_result >= FIRST_SERVER_RETURN_VALUE || - state.commit_result >= FIRST_SERVER_RETURN_VALUE; -} - } // namespace sessions } // namespace syncer diff --git a/sync/sessions/sync_session.h b/sync/sessions/sync_session.h index 7271b5f..9272bae 100644 --- a/sync/sessions/sync_session.h +++ b/sync/sessions/sync_session.h @@ -106,12 +106,6 @@ class SYNC_EXPORT_PRIVATE SyncSession { // Builds and sends a snapshot to the session context's listeners. void SendEventNotification(SyncEngineEvent::EventCause cause); - // Returns true if we reached the server. Note that "reaching the server" - // here means that from an HTTP perspective, we succeeded (HTTP 200). The - // server **MAY** have returned a sync protocol error. - // See SERVER_RETURN_* in the SyncerError enum for values. - bool DidReachServer() const; - // Overwrite the sync update source with the most recent and merge the // type/state map. void CoalesceSources(const SyncSourceInfo& source); |