From 7d4ae4ca6b0a2582c3983ccfc09a928d53ba0116 Mon Sep 17 00:00:00 2001 From: Audric Ackermann Date: Fri, 30 Jul 2021 10:36:25 +1000 Subject: [PATCH] swallow exception while saving seen messages --- app/sql.js | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/app/sql.js b/app/sql.js index 6e95708e5..b7fee1375 100644 --- a/app/sql.js +++ b/app/sql.js @@ -1915,20 +1915,24 @@ function updateLastHash(data) { function saveSeenMessageHash(data) { const { expiresAt, hash } = data; - globalInstance - .prepare( - `INSERT INTO seenMessages ( + try { + globalInstance + .prepare( + `INSERT INTO seenMessages ( expiresAt, hash ) values ( $expiresAt, $hash );` - ) - .run({ - expiresAt, - hash, - }); + ) + .run({ + expiresAt, + hash, + }); + } catch (e) { + console.warn('saveSeenMessageHash failed:', e); + } } function cleanLastHashes() {