mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-08-09 10:06:33 +02:00
refactor: dont create multiple instances of the cache (#3504)
This commit is contained in:
@@ -223,9 +223,7 @@ EOD
|
||||
// Try to get all tweets
|
||||
switch ($this->queriedContext) {
|
||||
case 'By username':
|
||||
$cacheFactory = new CacheFactory();
|
||||
$cache = $cacheFactory->create();
|
||||
|
||||
$cache = RssBridge::getCache();
|
||||
$cache->setScope('twitter');
|
||||
$cache->setKey(['cache']);
|
||||
// todo: inspect mtime instead of purging with 3h
|
||||
@@ -512,9 +510,7 @@ EOD;
|
||||
//This function takes 2 requests, and therefore is cached
|
||||
private function getApiKey($forceNew = 0)
|
||||
{
|
||||
$cacheFactory = new CacheFactory();
|
||||
|
||||
$r_cache = $cacheFactory->create();
|
||||
$r_cache = RssBridge::getCache();
|
||||
$scope = 'TwitterBridge';
|
||||
$r_cache->setScope($scope);
|
||||
$r_cache->setKey(['refresh']);
|
||||
@@ -530,7 +526,7 @@ EOD;
|
||||
|
||||
$cacheFactory = new CacheFactory();
|
||||
|
||||
$cache = $cacheFactory->create();
|
||||
$cache = RssBridge::getCache();
|
||||
$cache->setScope($scope);
|
||||
$cache->setKey(['api_key']);
|
||||
$data = $cache->loadData();
|
||||
@@ -565,9 +561,7 @@ EOD;
|
||||
$apiKey = $data;
|
||||
}
|
||||
|
||||
$cacheFac2 = new CacheFactory();
|
||||
|
||||
$gt_cache = $cacheFactory->create();
|
||||
$gt_cache = RssBridge::getCache();
|
||||
$gt_cache->setScope($scope);
|
||||
$gt_cache->setKey(['guest_token']);
|
||||
$guestTokenUses = $gt_cache->loadData();
|
||||
|
Reference in New Issue
Block a user