Remove obsolete cache

This commit is contained in:
Björn Fromme
2019-09-12 09:26:07 +02:00
parent debb27a612
commit 96f8311176
2 changed files with 2 additions and 25 deletions
@@ -30,8 +30,6 @@ namespace EP\EpProducts\Controller;
use EP\EpProducts\Domain\Model\Product;
use EP\EpProducts\Domain\Model\Reseller;
use EP\EpProducts\Service\ResellerDataService;
use TYPO3\CMS\Core\Cache\CacheManager;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Extbase\Mvc\Controller\ActionController;
class ResellerController extends ActionController
@@ -41,23 +39,14 @@ class ResellerController extends ActionController
*/
protected $resellerDataService;
/**
* @var \TYPO3\CMS\Core\Cache\Frontend\FrontendInterface
*/
protected $cache;
/**
* @param ResellerDataService $resellerDataService
* @throws \TYPO3\CMS\Core\Cache\Exception\NoSuchCacheException
*/
public function __construct(ResellerDataService $resellerDataService)
{
parent::__construct();
$this->resellerDataService = $resellerDataService;
/** @var CacheManager $cacheManager */
$cacheManager = GeneralUtility::makeInstance(CacheManager::class);
$this->cache = $cacheManager->getCache('ep_products_reseller');
}
/**
@@ -78,7 +67,7 @@ class ResellerController extends ActionController
/**
* @param Reseller $reseller
* @param Product $product
* @throws \Doctrine\DBAL\DBALException
* @throws \TYPO3\CMS\Extbase\Mvc\Exception\StopActionException
* @throws \TYPO3\CMS\Extbase\Mvc\Exception\UnsupportedRequestTypeException
*/
@@ -93,11 +82,7 @@ class ResellerController extends ActionController
);
}
$cacheKey = sprintf('reseller_export_cp_%d_%d', $product->getUid(), $reseller->getUid());
if (($productData = $this->cache->get($cacheKey)) === false) {
$productData = $this->resellerDataService->preprocessSingle($product, $reseller);
$this->cache->set($cacheKey, $productData, [], 3600);
}
$productData = $this->resellerDataService->preprocessSingle($product, $reseller);
$this->view->assign('reseller', $reseller);
$this->view->assign('productData', $productData);
@@ -370,11 +370,3 @@ $GLOBALS['TYPO3_CONF_VARS']['LOG']['EP']['EpProducts']['Controller']['writerConf
];
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/install']['update']['teamSlug'] = \EP\EpProducts\Updates\TeamSlugUpdater::class;
if (!is_array($GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['ep_products_reseller'])) {
$GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['ep_products_reseller'] = [];
}
if (!isset($GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['ep_products_reseller']['backend'])) {
$GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['ep_products_reseller']['backend'] = \TYPO3\CMS\Core\Cache\Backend\SimpleFileBackend::class;
}