Skip to content

Commit

Permalink
relay info id
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaoch05 committed Sep 22, 2023
1 parent 72ef0d4 commit bb4268b
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions apollo/src/aggregation/aggregation.resolver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -158,13 +158,18 @@ export class AggregationResolver {
@Args('relayer') relayer: string,
@Args('tokenAddress') tokenAddress: string
) {
const id = `lnv20-${fromChainId}-${toChainId}-${relayer}-${tokenAddress}`;
await this.aggregationService.updateLnv20RelayInfo({
where: { id: id },
data: {
heartbeatTimestamp: Math.floor(Date.now() / 1000),
},
});
const id = `lnv20-${fromChainId}-${toChainId}-${relayer.toLowerCase()}-${tokenAddress.toLowerCase()}`;
try {
await this.aggregationService.updateLnv20RelayInfo({
where: { id: id },
data: {
heartbeatTimestamp: Math.floor(Date.now() / 1000),
},
});
} catch (e) {
console.log(`heart beat failed ${id}`);
return;
}
}

@Query()
Expand Down

0 comments on commit bb4268b

Please sign in to comment.