repo: when there was an error syncing up, shorten the poll interval
This commit is contained in:
parent
63e5d14258
commit
4ddb888039
|
@ -174,9 +174,11 @@ namespace SparkleLib {
|
||||||
if (time_to_poll && !is_syncing) {
|
if (time_to_poll && !is_syncing) {
|
||||||
this.last_poll = DateTime.Now;
|
this.last_poll = DateTime.Now;
|
||||||
|
|
||||||
if (HasRemoteChanges)
|
if (HasRemoteChanges) {
|
||||||
|
this.poll_interval = PollInterval.Long
|
||||||
SyncDownBase ();
|
SyncDownBase ();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// In the unlikely case that we haven't synced up our
|
// In the unlikely case that we haven't synced up our
|
||||||
// changes or the server was down, sync up again
|
// changes or the server was down, sync up again
|
||||||
|
@ -314,6 +316,7 @@ namespace SparkleLib {
|
||||||
ChangeSets = GetChangeSets ();
|
ChangeSets = GetChangeSets ();
|
||||||
|
|
||||||
HasUnsyncedChanges = false;
|
HasUnsyncedChanges = false;
|
||||||
|
PollInterval = PollInterval.Long;
|
||||||
|
|
||||||
SyncStatusChanged (SyncStatus.Idle);
|
SyncStatusChanged (SyncStatus.Idle);
|
||||||
this.listener.Announce (new SparkleAnnouncement (Identifier, CurrentRevision));
|
this.listener.Announce (new SparkleAnnouncement (Identifier, CurrentRevision));
|
||||||
|
@ -332,6 +335,7 @@ namespace SparkleLib {
|
||||||
this.listener.Announce (new SparkleAnnouncement (Identifier, CurrentRevision));
|
this.listener.Announce (new SparkleAnnouncement (Identifier, CurrentRevision));
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
PollInterval = PollInterval.Short;
|
||||||
SyncStatusChanged (SyncStatus.Error);
|
SyncStatusChanged (SyncStatus.Error);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue