mirror of
https://github.com/DanielnetoDotCom/YouPHPTube
synced 2025-10-03 01:39:24 +02:00
Updates
This commit is contained in:
parent
004dfb668d
commit
6d653ee4e6
2 changed files with 9 additions and 3 deletions
|
@ -1065,10 +1065,11 @@ abstract class CacheHandler {
|
||||||
public function setCache($value) {
|
public function setCache($value) {
|
||||||
$name = $this->getCacheName( $this->suffix);
|
$name = $this->getCacheName( $this->suffix);
|
||||||
$return = ObjectYPT::setCacheGlobal($name, $value);
|
$return = ObjectYPT::setCacheGlobal($name, $value);
|
||||||
|
/*
|
||||||
if (empty($return) || ($return['type'] == 'file' && empty($return['bytes']))) {
|
if (empty($return) || ($return['type'] == 'file' && empty($return['bytes']))) {
|
||||||
_error_log("setCache {$this->suffix} " . json_encode($return));
|
_error_log("setCache {$this->suffix} " . json_encode($return));
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
return $return;
|
return $return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -364,8 +364,13 @@ class Cache extends PluginAbstract {
|
||||||
$cacheFound = 0;
|
$cacheFound = 0;
|
||||||
$cacheNotFound = 0;
|
$cacheNotFound = 0;
|
||||||
}
|
}
|
||||||
if($cacheNotFound>100){
|
if(!empty($lifetime)){
|
||||||
$lifetime = 0; // make it unlimited
|
if($cacheNotFound>100){
|
||||||
|
$lifetime = 0; // make it unlimited
|
||||||
|
}else {
|
||||||
|
// increase timeout
|
||||||
|
$lifetime += $cacheNotFound*30;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
$index = "{$name}_{$lifetime}";
|
$index = "{$name}_{$lifetime}";
|
||||||
if (empty($_getCacheDB[$index])) {
|
if (empty($_getCacheDB[$index])) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue