James E. Blair 86574f5eec Don't enqueue full syncs when going offline
Currently when gertty goes offline, it enqueues a task to sync all
subscribed projects and upload all pending reviews.  The intent
was to make sure gertty resynced quickly in case of an error.
However, because the project syncs were at a different priority
than the initial project syncs, they could interfere with each
other.  If a user started gertty after a period of disuse, the
initial normal priority sync could take a long time.  If it
encountered errors that took it offline, it would enqueue a high
priority project sync, which would then attempt to sync many
of the changes which had already been synced by the normal priority
sync (which had not finished and so had not updated the timestamp
for the project).  Further, this process could repeat if multiple
network errors occured.  Even further, if the network was flapping,
the queue could build up many project sync and upload review tasks
themselves.

The project sync on reconnect should not actually be necessary
because the periodic sync will take care of it, so it is removed
in this change.

The upload changes on reconnect similarly should not be necessary,
but it remains in this change out of an abundance of caution.  In
case an error disrupts a review upload task in such a way that it
is removed from the queue, this should increase the chance it is
still uploaded.  However, no more than one upload reviews task will
appear in the queue, so it should not grow without bound in the case
of repeated network errors.

Change-Id: Ia0be38625da363055b0451ff2ed80fed16281cda
2015-04-08 15:36:15 -04:00
..
2015-04-06 07:45:58 -07:00
2014-04-29 16:28:49 -07:00
2014-05-07 21:35:07 -04:00
2015-04-08 15:35:51 -04:00
2015-04-06 07:45:58 -07:00
2015-04-06 07:47:23 -07:00
2014-08-01 15:49:30 -07:00
2015-04-06 07:47:23 -07:00
2015-04-08 15:36:15 -04:00
2014-08-30 14:55:53 -07:00