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

@ -911,8 +911,9 @@ namespace SparkleLib.Git {
}
}
git_status.StandardOutput.ReadToEnd();
git_status.StandardOutput.ReadToEnd ();
git_status.WaitForExit ();
return message;
}

View file

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