mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-08-08 09:36:39 +02:00
refactor(cache): extract and encapsulate cache expiration logic (#3547)
* refactor(cache): extract and encapsulate cache expiration logic * fix: logic bug in getSimpleHTMLDOMCached * fix: silly me, index should of course be on the key column * silly me again, PRIMARY keys get index by default lol * comment out the delete portion in loadData * remove a few log statements * tweak twitter cache timeout
This commit is contained in:
@@ -7,7 +7,7 @@ class TwitterBridge extends BridgeAbstract
|
||||
const API_URI = 'https://api.twitter.com';
|
||||
const GUEST_TOKEN_USES = 100;
|
||||
const GUEST_TOKEN_EXPIRY = 10800; // 3hrs
|
||||
const CACHE_TIMEOUT = 300; // 5min
|
||||
const CACHE_TIMEOUT = 60 * 15; // 15min
|
||||
const DESCRIPTION = 'returns tweets';
|
||||
const MAINTAINER = 'arnd-s';
|
||||
const PARAMETERS = [
|
||||
@@ -224,10 +224,6 @@ EOD
|
||||
switch ($this->queriedContext) {
|
||||
case 'By username':
|
||||
$cache = RssBridge::getCache();
|
||||
$cache->setScope('twitter');
|
||||
$cache->setKey(['cache']);
|
||||
// todo: inspect mtime instead of purging with 3h
|
||||
$cache->purgeCache(60 * 60 * 3);
|
||||
$api = new TwitterClient($cache);
|
||||
|
||||
$screenName = $this->getInput('u');
|
||||
|
Reference in New Issue
Block a user