repo: don't allow multiple syncs at the same time on startup. Fixes #985

This commit is contained in:
Hylke Bons 2012-09-22 22:43:40 +01:00
parent 321efb4384
commit 0286060d9a
2 changed files with 6 additions and 5 deletions

View file

@ -913,6 +913,7 @@ namespace SparkleLib.Git {
git_status.StandardOutput.ReadToEnd (); git_status.StandardOutput.ReadToEnd ();
git_status.WaitForExit (); git_status.WaitForExit ();
return message; return message;
} }

View file

@ -193,10 +193,10 @@ namespace SparkleLib {
// Sync up everything that changed // Sync up everything that changed
// since we've been offline // since we've been offline
if (HasLocalChanges) { if (!this.is_syncing && (HasLocalChanges || HasUnsyncedChanges)) {
SyncUpBase (); SyncUpBase ();
while (HasUnsyncedChanges) while (HasLocalChanges)
SyncUpBase (); SyncUpBase ();
} }
@ -408,7 +408,7 @@ namespace SparkleLib {
this.poll_interval = PollInterval.Long; this.poll_interval = PollInterval.Long;
new Thread (() => { new Thread (() => {
if (!is_syncing && !HasLocalChanges && HasRemoteChanges) if (!this.is_syncing && !HasLocalChanges && HasRemoteChanges)
SyncDownBase (); SyncDownBase ();
}).Start (); }).Start ();
@ -430,7 +430,7 @@ namespace SparkleLib {
this.poll_interval = PollInterval.Long; this.poll_interval = PollInterval.Long;
this.last_poll = DateTime.Now; this.last_poll = DateTime.Now;
if (!is_syncing) { if (!this.is_syncing) {
// Check for changes manually one more time // Check for changes manually one more time
if (HasRemoteChanges) if (HasRemoteChanges)
SyncDownBase (); SyncDownBase ();