Commit 4a232327 authored by Jens Jacobsen's avatar Jens Jacobsen

Use ext:solr garbage collector

parent f212542f
Pipeline #4319 passed with stages
in 5 minutes and 40 seconds
......@@ -14,6 +14,7 @@ namespace T3o\TerFe2\Controller;
* The TYPO3 project - inspiring people to share!
*/
use ApacheSolrForTypo3\Solr\GarbageCollector;
use ApacheSolrForTypo3\Solr\IndexQueue\Queue;
use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
use TYPO3\CMS\Core\Utility\GeneralUtility;
......@@ -225,11 +226,13 @@ class RegisterkeyController extends \T3o\TerFe2\Controller\AbstractTerBasedContr
} elseif ((strtolower($extension->getFrontendUser()) == strtolower($GLOBALS['TSFE']->fe_user->user['username'])) || $this->securityRole->isAdmin()) {
// Deleted in ter, then delete the key in the ter_fe2 extension table
if ($this->terConnection->deleteExtensionKey($extension->getExtKey())) {
$extensionUid = $extension->getUid();
$this->extensionRepository->remove($extension);
// remove from index queue
// ext:solr garbage collector
if (ExtensionManagementUtility::isLoaded('solr')) {
$indexQueue = GeneralUtility::makeInstance(Queue::class);
$indexQueue->deleteItem('tx_terfe2_domain_model_extension', $extension->getUid());
$garbageCollector = GeneralUtility::makeInstance(GarbageCollector::class);
$garbageCollector->collectGarbage('tx_terfe2_domain_model_extension', $extensionUid);
}
$this->addFlashMessage(
'',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment