feat: improve sqlite cache robustness (#3715)

This commit is contained in:
Dag 2023-09-28 22:21:56 +02:00 committed by GitHub
parent f9ec88fb45
commit 0de5180ded
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -86,8 +86,13 @@ class SQLiteCache implements CacheInterface
$stmt->bindValue(':key', $cacheKey); $stmt->bindValue(':key', $cacheKey);
$stmt->bindValue(':value', $blob, \SQLITE3_BLOB); $stmt->bindValue(':value', $blob, \SQLITE3_BLOB);
$stmt->bindValue(':updated', $expiration); $stmt->bindValue(':updated', $expiration);
$result = $stmt->execute(); try {
// Unclear whether we should $result->finalize(); here? $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 public function delete(string $key): void