Commit 900eb438 authored by Sebastian Kummer's avatar Sebastian Kummer

ZP-1047 Better logging when moving large amounts of messages in one

request.

Released under the Affero GNU General Public License (AGPL) version 3.
parent 1d2b977c
......@@ -86,7 +86,10 @@ class MoveItems extends RequestProcessor {
self::$encoder->startTag(SYNC_MOVE_MOVES);
$operationResults = array();
$operationCounter = 0;
foreach($moves as $move) {
$operationCounter++;
self::$encoder->startTag(SYNC_MOVE_RESPONSE);
self::$encoder->startTag(SYNC_MOVE_SRCMSGID);
self::$encoder->content($move["srcmsgid"]);
......@@ -141,7 +144,15 @@ class MoveItems extends RequestProcessor {
$status = $stex->getCode();
}
self::$topCollector->AnnounceInformation(sprintf("Operation status: %s", $status), true);
if ($operationCounter % 10 == 0) {
self::$topCollector->AnnounceInformation(sprintf("Moved %d objects out of %d", $operationCounter, count($moves)));
}
// save the operation result
if (!isset($operationResults[$status])) {
$operationResults[$status] = 0;
}
$operationResults[$status]++;
self::$encoder->startTag(SYNC_MOVE_STATUS);
self::$encoder->content($status);
......@@ -153,6 +164,12 @@ class MoveItems extends RequestProcessor {
self::$encoder->endTag();
}
self::$topCollector->AnnounceInformation(sprintf("Moved %d - Codes", count($moves)), true);
foreach ($operationResults as $status => $occurences) {
self::$topCollector->AnnounceInformation(sprintf("%dx%d", $occurences, $status), true);
}
self::$encoder->endTag();
return true;
}
......
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