mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-07-30 21:30:14 +02:00
chore: prepare 2023-09-24 release (#3703)
This commit is contained in:
@@ -36,7 +36,7 @@ class FileCache implements CacheInterface
|
||||
$this->delete($key);
|
||||
return $default;
|
||||
}
|
||||
$expiration = $item['expiration'];
|
||||
$expiration = $item['expiration'] ?? time();
|
||||
if ($expiration === 0 || $expiration > time()) {
|
||||
return $item['value'];
|
||||
}
|
||||
@@ -92,7 +92,7 @@ class FileCache implements CacheInterface
|
||||
unlink($cacheFile);
|
||||
continue;
|
||||
}
|
||||
$expiration = $item['expiration'];
|
||||
$expiration = $item['expiration'] ?? time();
|
||||
if ($expiration === 0 || $expiration > time()) {
|
||||
continue;
|
||||
}
|
||||
|
@@ -37,10 +37,14 @@ class SQLiteCache implements CacheInterface
|
||||
$this->db = new \SQLite3($config['file']);
|
||||
$this->db->enableExceptions(true);
|
||||
$this->db->exec("CREATE TABLE storage ('key' BLOB PRIMARY KEY, 'value' BLOB, 'updated' INTEGER)");
|
||||
// Consider uncommenting this to add an index on expiration
|
||||
//$this->db->exec('CREATE INDEX idx_storage_updated ON storage (updated)');
|
||||
}
|
||||
$this->db->busyTimeout($config['timeout']);
|
||||
|
||||
// https://www.sqlite.org/pragma.html#pragma_journal_mode
|
||||
$this->db->exec('PRAGMA journal_mode = wal');
|
||||
|
||||
// https://www.sqlite.org/pragma.html#pragma_synchronous
|
||||
$this->db->exec('PRAGMA synchronous = NORMAL');
|
||||
}
|
||||
|
Reference in New Issue
Block a user