Skip to content
Snippets Groups Projects
Commit db5e7aee authored by catch's avatar catch
Browse files

Issue #3520750 by alexpott: Use a transaction PoDatabaseWriter to improve performance

(cherry picked from commit c15eed32)
parent 362cab42
No related branches found
No related tags found
1 merge request!12357Issue #3529639 by mradcliffe, smustgrave, solomon.yifru: replacing a depricated css
Pipeline #508959 passed with warnings
Pipeline: drupal

#508978

    Pipeline: drupal

    #508976

      Pipeline: drupal

      #508974

        +4
        ......@@ -198,10 +198,15 @@ public function writeItem(PoItem $item) {
        * {@inheritdoc}
        */
        public function writeItems(PoReaderInterface $reader, $count = -1) {
        // Processing multiple writes in a transaction is quicker than committing
        // each individual write.
        $transaction = \Drupal::database()->startTransaction();
        $forever = $count == -1;
        while (($count-- > 0 || $forever) && ($item = $reader->readItem())) {
        $this->writeItem($item);
        }
        // Commit the transaction.
        unset($transaction);
        }
        /**
        ......
        0% Loading or .
        You are about to add 0 people to the discussion. Proceed with caution.
        Please register or to comment