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
1 changed files with 7 additions and 2 deletions

View File

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