From 473534bc3556d8dc29a3856331544b54783a4746 Mon Sep 17 00:00:00 2001 From: James Grugett Date: Tue, 1 Feb 2022 21:35:41 -0600 Subject: [PATCH] Catch user update --- functions/src/update-contract-metrics.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/functions/src/update-contract-metrics.ts b/functions/src/update-contract-metrics.ts index 4825db4f..51c420ad 100644 --- a/functions/src/update-contract-metrics.ts +++ b/functions/src/update-contract-metrics.ts @@ -39,9 +39,13 @@ export const updateContractMetrics = functions.pubsub ) for (const [userId, score] of Object.entries(userScores)) { - await firestore.collection('users').doc(userId).update({ - totalPnLCached: score, - }) + await firestore + .collection('users') + .doc(userId) + .update({ + totalPnLCached: score, + }) + .catch((e) => console.log('failed to update user', userId, e)) } })