mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-08-04 01:55:21 +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:
parent
087e790ec1
commit
6254b8593e
12 changed files with 124 additions and 137 deletions
|
@ -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');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue