diff --git a/_config/processor.yml b/_config/processor.yml index ca5cb03..71ba961 100644 --- a/_config/processor.yml +++ b/_config/processor.yml @@ -11,7 +11,7 @@ SilverStripe\Core\Injector\Injector: --- Name: queuedjobprocessor Only: - ModuleExists: silverstripe/queuedjobs + ModuleExists: symbiote/silverstripe-queuedjobs Except: Environment: 'dev' --- diff --git a/src/Search/Processors/SearchUpdateCommitJobProcessor.php b/src/Search/Processors/SearchUpdateCommitJobProcessor.php index 09a96e7..7f85a64 100644 --- a/src/Search/Processors/SearchUpdateCommitJobProcessor.php +++ b/src/Search/Processors/SearchUpdateCommitJobProcessor.php @@ -10,12 +10,12 @@ use DateTime; use DateInterval; use stdClass; -if (!interface_exists('SilverStripe\QueuedJobs\Services\QueuedJob')) { +if (!interface_exists('Symbiote\QueuedJobs\Services\QueuedJob')) { return; } -use SilverStripe\QueuedJobs\Services\QueuedJob; -use SilverStripe\QueuedJobs\Services\QueuedJobService; +use Symbiote\QueuedJobs\Services\QueuedJob; +use Symbiote\QueuedJobs\Services\QueuedJobService; class SearchUpdateCommitJobProcessor implements QueuedJob { diff --git a/src/Search/Processors/SearchUpdateQueuedJobProcessor.php b/src/Search/Processors/SearchUpdateQueuedJobProcessor.php index 19a2a06..06596a4 100644 --- a/src/Search/Processors/SearchUpdateQueuedJobProcessor.php +++ b/src/Search/Processors/SearchUpdateQueuedJobProcessor.php @@ -5,12 +5,12 @@ namespace SilverStripe\FullTextSearch\Search\Processors; use SilverStripe\Core\Config\Config; use stdClass; -if (!interface_exists('SilverStripe\QueuedJobs\Services\QueuedJob')) { +if (!interface_exists('Symbiote\QueuedJobs\Services\QueuedJob')) { return; } -use SilverStripe\QueuedJobs\Services\QueuedJob; -use SilverStripe\QueuedJobs\Services\QueuedJobService; +use Symbiote\QueuedJobs\Services\QueuedJob; +use Symbiote\QueuedJobs\Services\QueuedJobService; class SearchUpdateQueuedJobProcessor extends SearchUpdateBatchedProcessor implements QueuedJob { diff --git a/src/Solr/Reindex/Handlers/SolrReindexQueuedHandler.php b/src/Solr/Reindex/Handlers/SolrReindexQueuedHandler.php index d7b9d43..3289580 100644 --- a/src/Solr/Reindex/Handlers/SolrReindexQueuedHandler.php +++ b/src/Solr/Reindex/Handlers/SolrReindexQueuedHandler.php @@ -12,13 +12,13 @@ use SilverStripe\FullTextSearch\Solr\Reindex\Jobs\SolrReindexQueuedJob; use SilverStripe\FullTextSearch\Solr\Reindex\Jobs\SolrReindexGroupQueuedJob; use SilverStripe\FullTextSearch\Search\Processors\SearchUpdateCommitJobProcessor; -if (!interface_exists('SilverStripe\QueuedJobs\Services\QueuedJob')) { +if (!interface_exists('Symbiote\QueuedJobs\Services\QueuedJob')) { return; } -use SilverStripe\QueuedJobs\Services\QueuedJob; -use SilverStripe\QueuedJobs\Services\QueuedJobService; -use SilverStripe\QueuedJobs\DataObjects\QueuedJobDescriptor; +use Symbiote\QueuedJobs\Services\QueuedJob; +use Symbiote\QueuedJobs\Services\QueuedJobService; +use Symbiote\QueuedJobs\DataObjects\QueuedJobDescriptor; /** * Represents a queued task to start the reindex job diff --git a/src/Solr/Reindex/Jobs/SolrReindexGroupQueuedJob.php b/src/Solr/Reindex/Jobs/SolrReindexGroupQueuedJob.php index 0425eee..92c1730 100644 --- a/src/Solr/Reindex/Jobs/SolrReindexGroupQueuedJob.php +++ b/src/Solr/Reindex/Jobs/SolrReindexGroupQueuedJob.php @@ -2,7 +2,7 @@ namespace SilverStripe\FullTextSearch\Solr\Reindex\Jobs; -if (!interface_exists('SilverStripe\QueuedJobs\Services\QueuedJob')) { +if (!interface_exists('Symbiote\QueuedJobs\Services\QueuedJob')) { return; } diff --git a/src/Solr/Reindex/Jobs/SolrReindexQueuedJob.php b/src/Solr/Reindex/Jobs/SolrReindexQueuedJob.php index ffde662..11128d3 100644 --- a/src/Solr/Reindex/Jobs/SolrReindexQueuedJob.php +++ b/src/Solr/Reindex/Jobs/SolrReindexQueuedJob.php @@ -2,7 +2,7 @@ namespace SilverStripe\FullTextSearch\Solr\Reindex\Jobs; -if (!interface_exists('SilverStripe\QueuedJobs\Services\QueuedJob')) { +if (!interface_exists('Symbiote\QueuedJobs\Services\QueuedJob')) { return; } diff --git a/src/Solr/Reindex/Jobs/SolrReindexQueuedJobBase.php b/src/Solr/Reindex/Jobs/SolrReindexQueuedJobBase.php index 2251dcb..0e0fc54 100644 --- a/src/Solr/Reindex/Jobs/SolrReindexQueuedJobBase.php +++ b/src/Solr/Reindex/Jobs/SolrReindexQueuedJobBase.php @@ -9,11 +9,11 @@ use SilverStripe\FullTextSearch\Solr\Reindex\Handlers\SolrReindexHandler; use SilverStripe\FullTextSearch\Utils\Logging\SearchLogFactory; use stdClass; -if (!interface_exists('SilverStripe\QueuedJobs\Services\QueuedJob')) { +if (!interface_exists('Symbiote\QueuedJobs\Services\QueuedJob')) { return; } -use SilverStripe\QueuedJobs\Services\QueuedJob; +use Symbiote\QueuedJobs\Services\QueuedJob; /** * Base class for jobs which perform re-index diff --git a/src/Utils/Logging/QueuedJobLogHandler.php b/src/Utils/Logging/QueuedJobLogHandler.php index bc54bf0..76eb581 100644 --- a/src/Utils/Logging/QueuedJobLogHandler.php +++ b/src/Utils/Logging/QueuedJobLogHandler.php @@ -5,11 +5,11 @@ namespace SilverStripe\FullTextSearch\Utils\Logging; use Monolog\Handler\AbstractProcessingHandler; use Monolog\Logger; -if (!interface_exists('SilverStripe\QueuedJobs\Services\QueuedJob')) { +if (!interface_exists('Symbiote\QueuedJobs\Services\QueuedJob')) { return; } -use SilverStripe\QueuedJobs\Services\QueuedJob; +use Symbiote\QueuedJobs\Services\QueuedJob; /** * Handler for logging events into QueuedJob message data diff --git a/tests/BatchedProcessorTest.php b/tests/BatchedProcessorTest.php index b775006..77cf615 100644 --- a/tests/BatchedProcessorTest.php +++ b/tests/BatchedProcessorTest.php @@ -16,7 +16,7 @@ use SilverStripe\FullTextSearch\Search\Processors\SearchUpdateQueuedJobProcessor use SilverStripe\FullTextSearch\Search\Processors\SearchUpdateBatchedProcessor; use SilverStripe\FullTextSearch\Search\Updaters\SearchUpdater; use SilverStripe\FullTextSearch\Search\Variants\SearchVariantVersioned; -use SilverStripe\QueuedJobs\Services\QueuedJobService; +use Symbiote\QueuedJobs\Services\QueuedJobService; /** * Tests {@see SearchUpdateQueuedJobProcessor} @@ -39,21 +39,25 @@ class BatchedProcessorTest extends SapphireTest public function setUpOnce() { // Disable illegal extensions if skipping this test - if (class_exists('Subsite') || !interface_exists('SilverStripe\QueuedJobs\Services\QueuedJob')) { + if (class_exists('Subsite') || !interface_exists('Symbiote\QueuedJobs\Services\QueuedJob')) { $this->illegalExtensions = array(); } parent::setUpOnce(); } - public function setUp() + protected function setUp() { + Config::modify()->set(SearchUpdater::class, 'flush_on_shutdown', false); + parent::setUp(); - if (!interface_exists('SilverStripe\QueuedJobs\Services\QueuedJob')) { + if (!interface_exists('Symbiote\QueuedJobs\Services\QueuedJob')) { $this->skipTest = true; $this->markTestSkipped("These tests need the QueuedJobs module installed to run"); } + Config::modify()->set(QueuedJobService::class, 'use_shutdown_function', false); + if (class_exists('Subsite')) { $this->skipTest = true; $this->markTestSkipped(get_class() . ' skipped when running with subsites'); diff --git a/tests/BatchedProcessorTest/BatchedProcessor_QueuedJobService.php b/tests/BatchedProcessorTest/BatchedProcessor_QueuedJobService.php index 572347c..0405762 100644 --- a/tests/BatchedProcessorTest/BatchedProcessor_QueuedJobService.php +++ b/tests/BatchedProcessorTest/BatchedProcessor_QueuedJobService.php @@ -2,7 +2,7 @@ namespace SilverStripe\FullTextSearch\Tests\BatchedProcessorTest; -use SilverStripe\QueuedJobs\Services\QueuedJob; +use Symbiote\QueuedJobs\Services\QueuedJob; class BatchedProcessor_QueuedJobService { diff --git a/tests/SolrReindexQueuedTest.php b/tests/SolrReindexQueuedTest.php index 243ddd7..1328692 100644 --- a/tests/SolrReindexQueuedTest.php +++ b/tests/SolrReindexQueuedTest.php @@ -8,6 +8,7 @@ use SilverStripe\Dev\SapphireTest; use SilverStripe\ORM\DataObject; use SilverStripe\ORM\DB; use SilverStripe\FullTextSearch\Search\FullTextSearch; +use SilverStripe\FullTextSearch\Search\Updaters\SearchUpdater; use SilverStripe\FullTextSearch\Solr\Reindex\Handlers\SolrReindexQueuedHandler; use SilverStripe\FullTextSearch\Solr\Reindex\Handlers\SolrReindexHandler; use SilverStripe\FullTextSearch\Solr\Services\Solr4Service; @@ -18,8 +19,8 @@ use SilverStripe\FullTextSearch\Tests\SolrReindexTest\SolrReindexTest_Index; use SilverStripe\FullTextSearch\Tests\SolrReindexTest\SolrReindexTest_Item; use SilverStripe\FullTextSearch\Tests\SolrReindexTest\SolrReindexTest_RecordingLogger; use SilverStripe\FullTextSearch\Tests\SolrReindexQueuedTest\SolrReindexQueuedTest_Service; -use SilverStripe\QueuedJobs\Services\QueuedJob; -use SilverStripe\QueuedJobs\Services\QueuedJobService; +use Symbiote\QueuedJobs\Services\QueuedJob; +use Symbiote\QueuedJobs\Services\QueuedJobService; /** * Additional tests of solr reindexing processes when run with queuedjobs @@ -46,15 +47,19 @@ class SolrReindexQueuedTest extends SapphireTest */ protected $service = null; - public function setUp() + protected function setUp() { + Config::modify()->set(SearchUpdater::class, 'flush_on_shutdown', false); + parent::setUp(); - if (!interface_exists('SilverStripe\QueuedJobs\Services\QueuedJob')) { + if (!interface_exists('Symbiote\QueuedJobs\Services\QueuedJob')) { $this->skipTest = true; return $this->markTestSkipped("These tests need the QueuedJobs module installed to run"); } + Config::modify()->set(QueuedJobService::class, 'use_shutdown_function', false); + // Set queued handler for reindex Config::modify()->set(Injector::class, SolrReindexHandler::class, array( 'class' => SolrReindexQueuedHandler::class diff --git a/tests/SolrReindexQueuedTest/SolrReindexQueuedTest_Service.php b/tests/SolrReindexQueuedTest/SolrReindexQueuedTest_Service.php index a5c0626..7150b55 100644 --- a/tests/SolrReindexQueuedTest/SolrReindexQueuedTest_Service.php +++ b/tests/SolrReindexQueuedTest/SolrReindexQueuedTest_Service.php @@ -4,11 +4,11 @@ namespace SilverStripe\FullTextSearch\Tests\SolrReindexQueuedTest; use SilverStripe\Dev\TestOnly; -if (!class_exists('SilverStripe\QueuedJobs\Services\QueuedJobService')) { +if (!class_exists('Symbiote\QueuedJobs\Services\QueuedJobService')) { return; } -use SilverStripe\QueuedJobs\Services\QueuedJobService; +use Symbiote\QueuedJobs\Services\QueuedJobService; class SolrReindexQueuedTest_Service extends QueuedJobService implements TestOnly {