} if (isset($_SESSION["arMoveStat_size"])) { $_size = doubleval($_SESSION["arMoveStat_size"]); } if (isset($_SESSION["arMoveStat_skip"])) { $_skip = intval($_SESSION["arMoveStat_skip"]); } } $files_per_step = 50; $rsNextFile = $DB->Query($DB->TopSQL("\n\t\t\t\t\tSELECT *\n\t\t\t\t\tFROM b_file\n\t\t\t\t\tWHERE ID > " . intval($ob->LAST_FILE_ID) . "\n\t\t\t\t\tAND (HANDLER_ID IS NULL OR HANDLER_ID <> '" . $DB->ForSQL($ob->ID) . "')\n\t\t\t\t\tORDER BY ID ASC\n\t\t\t\t", $files_per_step)); $counter = 0; $bWasMoved = false; $moveResult = CCloudStorage::FILE_SKIPPED; while ($moveResult == CCloudStorage::FILE_PARTLY_UPLOADED || is_array($arFile = $rsNextFile->Fetch())) { CCloudStorage::FixFileContentType($arFile); $moveResult = CCloudStorage::MoveFile($arFile, $ob); if ($moveResult == CCloudStorage::FILE_MOVED) { $DB->Query("\n\t\t\t\t\t\t\tUPDATE b_file\n\t\t\t\t\t\t\tSET HANDLER_ID = '" . $DB->ForSQL($ob->ID) . "'\n\t\t\t\t\t\t\tWHERE ID = " . intval($arFile["ID"]) . "\n\t\t\t\t\t\t"); CFile::CleanCache($arFile["ID"]); $_done += 1; $_size += doubleval($arFile["FILE_SIZE"]); $bWasMoved = true; $ob->Update(array("LAST_FILE_ID" => $arFile["ID"])); $counter++; } elseif ($moveResult == CCloudStorage::FILE_SKIPPED) { $e = $APPLICATION->GetException(); if (is_object($e)) { $message = new CAdminMessage(GetMessage("CLO_STORAGE_LIST_MOVE_FILE_ERROR"), $e); break; } else { $_skip += 1;