refactor: move cache logic into the factory (#2884)

This commit is contained in:
Dag 2022-07-05 13:20:01 +02:00 committed by GitHub
parent 5b9b579652
commit 321ec7c8c1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 16 additions and 15 deletions

View file

@ -407,7 +407,7 @@ abstract class BridgeAbstract implements BridgeInterface
{
$cacheFac = new CacheFactory();
$cache = $cacheFac->create(Configuration::getConfig('cache', 'type'));
$cache = $cacheFac->create();
$cache->setScope(get_called_class());
$cache->setKey($key);
if ($cache->getTime() < time() - $duration) {
@ -426,7 +426,7 @@ abstract class BridgeAbstract implements BridgeInterface
{
$cacheFac = new CacheFactory();
$cache = $cacheFac->create(Configuration::getConfig('cache', 'type'));
$cache = $cacheFac->create();
$cache->setScope(get_called_class());
$cache->setKey($key);
$cache->saveData($value);