mirror of
https://github.com/slawkens/myaac.git
synced 2025-04-26 09:19:22 +02:00
Fix RateLimit when cache is disabled
This commit is contained in:
parent
95a7c23a70
commit
c6cc84a668
@ -76,7 +76,7 @@ class RateLimit
|
||||
public function save(): void
|
||||
{
|
||||
global $cache;
|
||||
if (!$this->enabled) {
|
||||
if (!$this->enabled || !$cache->enabled()) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -92,7 +92,7 @@ class RateLimit
|
||||
}
|
||||
|
||||
$data = [];
|
||||
if ($this->enabled && $cache->enabled()) {
|
||||
if ($cache->enabled()) {
|
||||
$tmp = '';
|
||||
if ($cache->fetch($this->key, $tmp)) {
|
||||
$data = unserialize($tmp);
|
||||
@ -110,8 +110,6 @@ class RateLimit
|
||||
|
||||
$this->save();
|
||||
}
|
||||
} else {
|
||||
$data = [];
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user