aboutsummaryrefslogtreecommitdiff
path: root/lib/BridgeAbstract.php
diff options
context:
space:
mode:
authorGravatar Dag <me@dvikan.no> 2023-07-08 17:03:12 +0200
committerGravatar GitHub <noreply@github.com> 2023-07-08 17:03:12 +0200
commitc1c8304fc05ffa2a2966434ec8251975100bf85b (patch)
treec86579f031abbe2e1f2c057f3d3943ff7d24dbbb /lib/BridgeAbstract.php
parentb594ad2de347326739f3b9ff4eaf68580903c41d (diff)
downloadrss-bridge-c1c8304fc05ffa2a2966434ec8251975100bf85b.tar.gz
rss-bridge-c1c8304fc05ffa2a2966434ec8251975100bf85b.tar.zst
rss-bridge-c1c8304fc05ffa2a2966434ec8251975100bf85b.zip
refactor: dont create multiple instances of the cache (#3504)
Diffstat (limited to 'lib/BridgeAbstract.php')
-rw-r--r--lib/BridgeAbstract.php8
1 files changed, 2 insertions, 6 deletions
diff --git a/lib/BridgeAbstract.php b/lib/BridgeAbstract.php
index 21206a7b..3a2c47f2 100644
--- a/lib/BridgeAbstract.php
+++ b/lib/BridgeAbstract.php
@@ -415,9 +415,7 @@ abstract class BridgeAbstract implements BridgeInterface
*/
protected function loadCacheValue(string $key, $duration = null)
{
- $cacheFactory = new CacheFactory();
-
- $cache = $cacheFactory->create();
+ $cache = RssBridge::getCache();
// Create class name without the namespace part
$scope = $this->getShortName();
$cache->setScope($scope);
@@ -441,9 +439,7 @@ abstract class BridgeAbstract implements BridgeInterface
*/
protected function saveCacheValue(string $key, $value)
{
- $cacheFactory = new CacheFactory();
-
- $cache = $cacheFactory->create();
+ $cache = RssBridge::getCache();
$scope = $this->getShortName();
$cache->setScope($scope);
$cache->setKey([$key]);