From c14af333f72ad024253ba79be6aa01edac940faf Mon Sep 17 00:00:00 2001 From: DariusIII Date: Tue, 7 Mar 2023 11:13:51 +0100 Subject: [PATCH] Remove _rollbackAddToPartRepair unused function --- Blacklight/Binaries.php | 40 +++++++++------------------------------- 1 file changed, 9 insertions(+), 31 deletions(-) diff --git a/Blacklight/Binaries.php b/Blacklight/Binaries.php index c69692d66..a24858fbb 100644 --- a/Blacklight/Binaries.php +++ b/Blacklight/Binaries.php @@ -333,7 +333,7 @@ class Binaries // We will use this to subtract so we leave articles for the next time (in case the server doesn't have them yet) $leaveOver = $this->messageBuffer; - // If this is not a new group, go from our newest to the servers newest. + // If this is not a new group, go from our newest to the servers newest. } else { // Set our oldest wanted to our newest local article. $first = $groupMySQL['last_record']; @@ -377,14 +377,14 @@ class Binaries if ($this->_echoCLI) { $this->colorCli->primary( ( - (int) $groupMySQL['last_record'] === 0 - ? 'New group '.$groupNNTP['group'].' starting with '. - ( - $this->_newGroupScanByDays - ? $this->_newGroupDaysToScan.' days' - : number_format($this->_newGroupMessagesToScan).' messages' - ).' worth.' - : 'Group '.$groupNNTP['group'].' has '.number_format($realTotal).' new articles.' + (int) $groupMySQL['last_record'] === 0 + ? 'New group '.$groupNNTP['group'].' starting with '. + ( + $this->_newGroupScanByDays + ? $this->_newGroupDaysToScan.' days' + : number_format($this->_newGroupMessagesToScan).' messages' + ).' worth.' + : 'Group '.$groupNNTP['group'].' has '.number_format($realTotal).' new articles.' ). ' Leaving '.number_format($leaveOver). " for next pass.\nServer oldest: ".number_format($groupNNTP['first']). @@ -965,28 +965,6 @@ class Binaries } } - /** - * If we failed to insert Collections/Binaries/Parts, rollback the transaction and add the parts to part repair. - * - * @param array $headers Array of headers containing sub-arrays with parts. - * @return array Array of article numbers to add to part repair. - * - * @throws \Exception - * @throws \Throwable - */ - protected function _rollbackAddToPartRepair(array $headers): array - { - $headersNotInserted = []; - foreach ($headers as $header) { - foreach ($header as $file) { - $headersNotInserted[] = $file['Parts']['number']; - } - } - DB::rollBack(); - - return $headersNotInserted; - } - /** * Attempt to get missing article headers. *