From 0de5180ded1734a8e141390f6ae4b7db123bff8c Mon Sep 17 00:00:00 2001 From: Dag Date: Thu, 28 Sep 2023 22:21:56 +0200 Subject: [PATCH] feat: improve sqlite cache robustness (#3715) --- caches/SQLiteCache.php | 9 +++++++-- 1 file 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