1
0
Fork 0
mirror of https://github.com/DanielnetoDotCom/YouPHPTube synced 2025-10-03 01:39:24 +02:00
This commit is contained in:
Daniel Neto 2023-10-17 10:38:36 -03:00
parent 004dfb668d
commit 6d653ee4e6
2 changed files with 9 additions and 3 deletions

View file

@ -1065,10 +1065,11 @@ abstract class CacheHandler {
public function setCache($value) {
$name = $this->getCacheName( $this->suffix);
$return = ObjectYPT::setCacheGlobal($name, $value);
/*
if (empty($return) || ($return['type'] == 'file' && empty($return['bytes']))) {
_error_log("setCache {$this->suffix} " . json_encode($return));
}
*/
return $return;
}

View file

@ -364,8 +364,13 @@ class Cache extends PluginAbstract {
$cacheFound = 0;
$cacheNotFound = 0;
}
if($cacheNotFound>100){
$lifetime = 0; // make it unlimited
if(!empty($lifetime)){
if($cacheNotFound>100){
$lifetime = 0; // make it unlimited
}else {
// increase timeout
$lifetime += $cacheNotFound*30;
}
}
$index = "{$name}_{$lifetime}";
if (empty($_getCacheDB[$index])) {