FIX: allow update processor to be overriden by existing yml

One of the update commits (6066af5841) replaced SearchUpdateProcessor with SearchUpdateImmediateProcessor, but that means that the existing processor yml fails to replace the SearchUpdateImmediateProcessor with SearchUpdateQueuedJobProcessor  as I think is intended?

c.f https://github.com/silverstripe/silverstripe-fulltextsearch/blob/3/_config/processor.yml#L19
This commit is contained in:
Naomi Guyer 2020-02-10 17:05:16 +13:00
parent 43f92c74f7
commit d759a78182
1 changed files with 3 additions and 2 deletions

View File

@ -11,7 +11,8 @@ use SilverStripe\ORM\DB;
use SilverStripe\FullTextSearch\Search\FullTextSearch;
use SilverStripe\FullTextSearch\Search\SearchIntrospection;
use SilverStripe\FullTextSearch\Search\Variants\SearchVariant;
use SilverStripe\FullTextSearch\Search\Processors\SearchUpdateImmediateProcessor;
use SilverStripe\FullTextSearch\Search\Processors\SearchUpdateProcessor;
use ReflectionClass;
/**
@ -151,7 +152,7 @@ class SearchUpdater
foreach ($dirtyids as $dirtyclass => $ids) {
if ($ids) {
if (!self::$processor) {
self::$processor = Injector::inst()->create(SearchUpdateImmediateProcessor::class);
self::$processor = Injector::inst()->create(SearchUpdateProcessor::class);
}
self::$processor->addDirtyIDs($dirtyclass, $ids, $index);
}