Commit c8a54141 authored by Thomas Seidl's avatar Thomas Seidl
Browse files

Issue #3321677 by drunken monkey, david.muffley: Fixed out-of-memory errors during indexing.

parent d0ddc698
Loading
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
Search API 1.x, dev (xxxx-xx-xx):
---------------------------------
- #3321677 by drunken monkey, david.muffley: Fixed out-of-memory errors during
  indexing.
- #3397017 by drunken monkey, gaddman: Fixed MySQL error in edge cases when
  indexing bigrams.
- #3394738 by drunken monkey: Fixed fatal error after upgrade to 1.30.
+3 −6
Original line number Diff line number Diff line
@@ -1016,12 +1016,9 @@ class Index extends ConfigEntityBase implements IndexInterface {
      Cache::invalidateTags(['search_api_list:' . $this->id]);
    }

    // When indexing via Drush, multiple iterations of a batch will happen in
    // the same PHP process, so the static cache will quickly fill up. To
    // prevent this, clear it after each batch of items gets indexed.
    if (function_exists('drush_backend_batch_process') && batch_get()) {
    // Clear the static entity cache, to avoid running out of memory when
    // indexing lots of items in one process (especially via Drush).
    \Drupal::getContainer()->get('entity.memory_cache')->deleteAll();
    }

    return $processed_ids;
  }