aboutsummaryrefslogtreecommitdiff
path: root/caches/SQLiteCache.php
diff options
context:
space:
mode:
authorGravatar Dag <me@dvikan.no> 2023-09-28 22:21:56 +0200
committerGravatar GitHub <noreply@github.com> 2023-09-28 22:21:56 +0200
commit0de5180ded1734a8e141390f6ae4b7db123bff8c (patch)
treefad5d3c664d53cf0de6ae19a6affad3403667acc /caches/SQLiteCache.php
parentf9ec88fb45151712677107c51fc734f5a3c69038 (diff)
downloadrss-bridge-0de5180ded1734a8e141390f6ae4b7db123bff8c.tar.gz
rss-bridge-0de5180ded1734a8e141390f6ae4b7db123bff8c.tar.zst
rss-bridge-0de5180ded1734a8e141390f6ae4b7db123bff8c.zip
feat: improve sqlite cache robustness (#3715)
Diffstat (limited to 'caches/SQLiteCache.php')
-rw-r--r--caches/SQLiteCache.php9
1 files changed, 7 insertions, 2 deletions
diff --git a/caches/SQLiteCache.php b/caches/SQLiteCache.php
index becedde4..d7cba554 100644
--- a/caches/SQLiteCache.php
+++ b/caches/SQLiteCache.php
@@ -86,8 +86,13 @@ class SQLiteCache implements CacheInterface
$stmt->bindValue(':key', $cacheKey);
$stmt->bindValue(':value', $blob, \SQLITE3_BLOB);
$stmt->bindValue(':updated', $expiration);
- $result = $stmt->execute();
- // Unclear whether we should $result->finalize(); here?
+ try {
+ $result = $stmt->execute();
+ // Should $result->finalize() be called here?
+ } catch (\Exception $e) {
+ $this->logger->warning(create_sane_exception_message($e));
+ // Intentionally not rethrowing exception
+ }
}
public function delete(string $key): void