From 2f4231c07397d5bb82221e15e8d8eea5364161bc Mon Sep 17 00:00:00 2001 From: Hylke Bons Date: Wed, 29 May 2013 12:09:39 +0100 Subject: [PATCH] repo: Fix a possible race condition that can cause a double upload --- SparkleLib/SparkleRepoBase.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/SparkleLib/SparkleRepoBase.cs b/SparkleLib/SparkleRepoBase.cs index 9a7b91da..4f357940 100755 --- a/SparkleLib/SparkleRepoBase.cs +++ b/SparkleLib/SparkleRepoBase.cs @@ -260,13 +260,20 @@ namespace SparkleLib { SparkleLogger.LogInfo ("Local", Name + " | Activity has settled"); IsBuffering = false; - if (HasLocalChanges) { + bool first_sync = true; + + if (HasLocalChanges && Status == SyncStatus.Idle) { do { + if (!first_sync) + SparkleLogger.LogInfo ("Local", Name + " | More changes found"); + SyncUpBase (); if (Error == ErrorStatus.UnreadableFiles) return; + first_sync = false; + } while (HasLocalChanges); } else {