Commit 794f4f7a authored by Manfred Kutas's avatar Manfred Kutas

ZP-1398 Do not call $device->GetHierarchyCache() in loop.

Released under the Affero GNU General Public License (AGPL) version 3.
parent 4cbc0bbc
...@@ -989,11 +989,12 @@ class ZPushAdminCLI { ...@@ -989,11 +989,12 @@ class ZPushAdminCLI {
$synchedFolders = 0; $synchedFolders = 0;
$synchedFolderTypes = array(); $synchedFolderTypes = array();
$syncedFoldersInProgress = 0; $syncedFoldersInProgress = 0;
$hc = $device->GetHierarchyCache();
foreach ($folders as $folderid) { foreach ($folders as $folderid) {
if ($device->GetFolderUUID($folderid)) { if ($device->GetFolderUUID($folderid)) {
$synchedFolders++; $synchedFolders++;
$type = $device->GetFolderType($folderid); $type = $device->GetFolderType($folderid);
$folder = $device->GetHierarchyCache()->GetFolder($folderid); $folder = $hc->GetFolder($folderid);
$name = $folder ? $folder->displayname : "unknown"; $name = $folder ? $folder->displayname : "unknown";
switch($type) { switch($type) {
case SYNC_FOLDER_TYPE_APPOINTMENT: case SYNC_FOLDER_TYPE_APPOINTMENT:
......
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