Commit 5f3ef743 authored by Sebastian Kummer's avatar Sebastian Kummer

Merge pull request #538 in ZP/z-push from feature/ZP-1227-prioritize-koe-gab-sync to develop

* commit '87af5c80':
  ZP-1227 Sync the KOE GAB folder first by adding it to the top of the SyncCollection list.
parents 953269c4 87af5c80
......@@ -256,7 +256,14 @@ class SyncCollections implements Iterator {
if (! $spa->HasFolderId())
return false;
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