Skip to content

Commit

Permalink
cloud_functions: remove refTime check
Browse files Browse the repository at this point in the history
  • Loading branch information
panoel committed Jul 15, 2024
1 parent 37b81ea commit d015d56
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions cloud_functions/src/alarmMissingVaas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,15 +95,7 @@ export async function alarmMissingVaas(req: any, res: any) {
for (let i = 0; i < msgs.messages.length; i++) {
// Check the timestamp and only send messages that are older than MISS_THRESHOLD_IN_MINS
const msg: ObservedMessage = msgs.messages[i];
// If there is a reference time for this chain, use it. Otherwise, use the current time.
let timeToCheck = getMissThreshold(now, chainId);
if (refTimes[chainId]) {
let refTime = refTimes[chainId]?.latestTime;
if (refTime) {
const refDateTime = new Date(refTime);
timeToCheck = getMissThreshold(refDateTime, chainId);
}
}
const timeToCheck = getMissThreshold(now, chainId);
if (msg.timestamp < timeToCheck) {
let vaaKey: string = `${msg.chain}/${msg.emitter}/${msg.seq}`;
if (firestoreMap.has(vaaKey)) {
Expand Down

0 comments on commit d015d56

Please sign in to comment.