public function runGroup(LoggerInterface $logger, SolrIndex $indexInstance, $state, $class, $groups, $group) { parent::runGroup($logger, $indexInstance, $state, $class, $groups, $group); // After any changes have been made, mark all indexes as dirty for commit // see http://stackoverflow.com/questions/7512945/how-to-fix-exceeded-limit-of-maxwarmingsearchers $logger->info("Queuing commit on all changes"); SearchUpdateCommitJobProcessor::queue(); }
/** * Test creation of multiple commit jobs */ public function testMultipleCommits() { $index = singleton('BatchedProcessorTest_Index'); $index->reset(); // Test that running a commit immediately after submitting to the indexes // correctly commits $first = SearchUpdateCommitJobProcessor::queue(); $second = SearchUpdateCommitJobProcessor::queue(); $this->assertFalse($index->getIsCommitted()); // First process will cause the commit $this->assertFalse($first->jobFinished()); $first->process(); $allMessages = $first->getMessages(); $this->assertTrue($index->getIsCommitted()); $this->assertTrue($first->jobFinished()); $this->assertStringEndsWith('All indexes committed', $allMessages[2]); // Executing the subsequent processor should not re-trigger a commit $index->reset(); $this->assertFalse($second->jobFinished()); $second->process(); $allMessages = $second->getMessages(); $this->assertFalse($index->getIsCommitted()); $this->assertTrue($second->jobFinished()); $this->assertStringEndsWith('Indexing already completed this request: Discarding this job', $allMessages[0]); // Given that a third job is created, and the indexes are dirtied, attempting to run this job // should result in a delay $index->reset(); $third = SearchUpdateCommitJobProcessor::queue(); $this->assertFalse($third->jobFinished()); $third->process(); $this->assertTrue($third->jobFinished()); $allMessages = $third->getMessages(); $this->assertStringEndsWith('Indexing already run this request, but incomplete. Re-scheduling for 2015-05-07 06:10:00', $allMessages[0]); }
public function afterComplete() { // Once indexing is complete, commit later in order to avoid solr limits // see http://stackoverflow.com/questions/7512945/how-to-fix-exceeded-limit-of-maxwarmingsearchers SearchUpdateCommitJobProcessor::queue(); }