1
0
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:
Dag
2023-09-24 20:53:07 +02:00
committed by GitHub
parent f321f000c1
commit 857e908929
8 changed files with 19 additions and 232 deletions

View File

@@ -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;
}

View File

@@ -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');
}