Remove obsolete cache
This commit is contained in:
@@ -30,8 +30,6 @@ namespace EP\EpProducts\Controller;
|
|||||||
use EP\EpProducts\Domain\Model\Product;
|
use EP\EpProducts\Domain\Model\Product;
|
||||||
use EP\EpProducts\Domain\Model\Reseller;
|
use EP\EpProducts\Domain\Model\Reseller;
|
||||||
use EP\EpProducts\Service\ResellerDataService;
|
use EP\EpProducts\Service\ResellerDataService;
|
||||||
use TYPO3\CMS\Core\Cache\CacheManager;
|
|
||||||
use TYPO3\CMS\Core\Utility\GeneralUtility;
|
|
||||||
use TYPO3\CMS\Extbase\Mvc\Controller\ActionController;
|
use TYPO3\CMS\Extbase\Mvc\Controller\ActionController;
|
||||||
|
|
||||||
class ResellerController extends ActionController
|
class ResellerController extends ActionController
|
||||||
@@ -41,23 +39,14 @@ class ResellerController extends ActionController
|
|||||||
*/
|
*/
|
||||||
protected $resellerDataService;
|
protected $resellerDataService;
|
||||||
|
|
||||||
/**
|
|
||||||
* @var \TYPO3\CMS\Core\Cache\Frontend\FrontendInterface
|
|
||||||
*/
|
|
||||||
protected $cache;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param ResellerDataService $resellerDataService
|
* @param ResellerDataService $resellerDataService
|
||||||
* @throws \TYPO3\CMS\Core\Cache\Exception\NoSuchCacheException
|
|
||||||
*/
|
*/
|
||||||
public function __construct(ResellerDataService $resellerDataService)
|
public function __construct(ResellerDataService $resellerDataService)
|
||||||
{
|
{
|
||||||
parent::__construct();
|
parent::__construct();
|
||||||
|
|
||||||
$this->resellerDataService = $resellerDataService;
|
$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 Reseller $reseller
|
||||||
* @param Product $product
|
* @param Product $product
|
||||||
|
* @throws \Doctrine\DBAL\DBALException
|
||||||
* @throws \TYPO3\CMS\Extbase\Mvc\Exception\StopActionException
|
* @throws \TYPO3\CMS\Extbase\Mvc\Exception\StopActionException
|
||||||
* @throws \TYPO3\CMS\Extbase\Mvc\Exception\UnsupportedRequestTypeException
|
* @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());
|
$productData = $this->resellerDataService->preprocessSingle($product, $reseller);
|
||||||
if (($productData = $this->cache->get($cacheKey)) === false) {
|
|
||||||
$productData = $this->resellerDataService->preprocessSingle($product, $reseller);
|
|
||||||
$this->cache->set($cacheKey, $productData, [], 3600);
|
|
||||||
}
|
|
||||||
|
|
||||||
$this->view->assign('reseller', $reseller);
|
$this->view->assign('reseller', $reseller);
|
||||||
$this->view->assign('productData', $productData);
|
$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;
|
$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;
|
|
||||||
}
|
|
||||||
|
|||||||
Reference in New Issue
Block a user