repo: Fix a possible race condition that can cause a double upload
This commit is contained in:
parent
e188ae878c
commit
2f4231c073
|
@ -260,13 +260,20 @@ namespace SparkleLib {
|
||||||
SparkleLogger.LogInfo ("Local", Name + " | Activity has settled");
|
SparkleLogger.LogInfo ("Local", Name + " | Activity has settled");
|
||||||
IsBuffering = false;
|
IsBuffering = false;
|
||||||
|
|
||||||
if (HasLocalChanges) {
|
bool first_sync = true;
|
||||||
|
|
||||||
|
if (HasLocalChanges && Status == SyncStatus.Idle) {
|
||||||
do {
|
do {
|
||||||
|
if (!first_sync)
|
||||||
|
SparkleLogger.LogInfo ("Local", Name + " | More changes found");
|
||||||
|
|
||||||
SyncUpBase ();
|
SyncUpBase ();
|
||||||
|
|
||||||
if (Error == ErrorStatus.UnreadableFiles)
|
if (Error == ErrorStatus.UnreadableFiles)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
first_sync = false;
|
||||||
|
|
||||||
} while (HasLocalChanges);
|
} while (HasLocalChanges);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in a new issue