Skip to content

Commit

Permalink
watcher: remove try..catch block
Browse files Browse the repository at this point in the history
  • Loading branch information
panoel authored and evan-gray committed Jul 1, 2024
1 parent 0675552 commit 4943c13
Showing 1 changed file with 10 additions and 14 deletions.
24 changes: 10 additions & 14 deletions cloud_functions/src/computeMessageCountHistory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,21 +39,17 @@ export async function computeMessageCountHistory(req: any, res: any) {
skipRow = false;
continue;
}
try {
const parsed = parseVaa(signedVAA.data.info.bytes[0].value);
if (parsed.timestamp === 0) {
// e.g. governance VAAs may have timestamp set to 0
continue;
}
const date = new Date(parsed.timestamp * 1000).toISOString().slice(0, 10);
messageCounts.DailyTotals[date] = {
...messageCounts.DailyTotals[date],
[parsed.emitterChain]:
(messageCounts.DailyTotals[date]?.[parsed.emitterChain.toString()] || 0) + 1,
};
} catch (e) {
console.error('Skipping row due to: ' + e);
const parsed = parseVaa(signedVAA.data.info.bytes[0].value);
if (parsed.timestamp === 0) {
// e.g. governance VAAs may have timestamp set to 0
continue;
}
const date = new Date(parsed.timestamp * 1000).toISOString().slice(0, 10);
messageCounts.DailyTotals[date] = {
...messageCounts.DailyTotals[date],
[parsed.emitterChain]:
(messageCounts.DailyTotals[date]?.[parsed.emitterChain.toString()] || 0) + 1,
};
}
if (signedVAARows.length < readChunkSize) {
break;
Expand Down

0 comments on commit 4943c13

Please sign in to comment.