Fix refresh using cache
This commit is contained in:
parent
fffe2a06fc
commit
b0076f4aa6
1 changed files with 2 additions and 2 deletions
|
@ -24,13 +24,13 @@ class EmbedCache
|
|||
$this->filepath = $this->directory . '/' . $this->identifier;
|
||||
}
|
||||
|
||||
public function get(bool $generateCache = true): mixed
|
||||
public function get(bool $generateCache = false): mixed
|
||||
{
|
||||
$info = null;
|
||||
$maxAge = 2592000; // 30 days
|
||||
$age = file_exists($this->filepath) ? time() - filemtime($this->filepath) : $maxAge;
|
||||
|
||||
if ($this->exists() && $age <= $maxAge) {
|
||||
if ($this->exists() && $age <= $maxAge && false === $generateCache) {
|
||||
$info = json_decode(file_get_contents($this->filepath));
|
||||
} else {
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue