Commit 87af5c80 authored by Sebastian Kummer's avatar Sebastian Kummer

ZP-1227 Sync the KOE GAB folder first by adding it to the top of the

SyncCollection list.

Released under the Affero GNU General Public License (AGPL) version 3.
parent 0e4a1a39
......@@ -256,7 +256,14 @@ class SyncCollections implements Iterator {
if (! $spa->HasFolderId())
return false;
$this->collections[$spa->GetFolderId()] = $spa;
if ($spa->GetKoeGabFolder() === true) {
// put KOE GAB at the beginning of the sync
$this->collections = [$spa->GetFolderId() => $spa] + $this->collections;
ZLog::Write(LOGLEVEL_DEBUG, "SyncCollections->AddCollection(): Prioritizing KOE GAB folder for synchronization");
}
else {
$this->collections[$spa->GetFolderId()] = $spa;
}
ZLog::Write(LOGLEVEL_DEBUG, sprintf("SyncCollections->AddCollection(): Folder id '%s' : ref. PolicyKey '%s', ref. Lifetime '%s', last sync at '%s'", $spa->GetFolderId(), $spa->GetReferencePolicyKey(), $spa->GetReferenceLifetime(), $spa->GetLastSyncTime()));
if ($spa->HasLastSyncTime() && $spa->GetLastSyncTime() > $this->lastSyncTime) {
......
......@@ -182,6 +182,11 @@ class Sync extends RequestProcessor {
}
}
// determine if this is the KOE GAB folder so it can be prioritized by SyncCollections
if (KOE_CAPABILITY_GAB && self::$deviceManager->IsKoe() && $spa->GetBackendFolderId() == self::$deviceManager->GetKoeGabBackendFolderId()) {
$spa->SetKoeGabFolder(true);
}
// done basic SPA initialization/loading -> add to SyncCollection
$sc->AddCollection($spa);
$sc->AddParameter($spa, "requested", true);
......@@ -380,7 +385,7 @@ class Sync extends RequestProcessor {
}
// unset filtertype for KOE GAB folder
if (KOE_CAPABILITY_GAB && self::$deviceManager->IsKoe() && $spa->GetBackendFolderId() == self::$deviceManager->GetKoeGabBackendFolderId()) {
if ($spa->GetKoeGabFolder() === true) {
$spa->SetFilterType(SYNC_FILTERTYPE_ALL);
ZLog::Write(LOGLEVEL_DEBUG, "HandleSync(): KOE GAB folder - setting filter type to unlimited");
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment