Skip to content

Commit

Permalink
ignore if no softTransferLimit
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaoch05 committed Mar 8, 2024
1 parent 66831c6 commit c5f24dc
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions apollo/src/aggregation/aggregation.resolver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -175,13 +175,17 @@ export class AggregationResolver {
@Args('softTransferLimit') softTransferLimit: string
) {
const id = `${version}-${fromChainId}-${toChainId}-${relayer.toLowerCase()}-${tokenAddress.toLowerCase()}`;
let updateData = {
heartbeatTimestamp: Math.floor(Date.now() / 1000),
};
if (softTransferLimit !== undefined && softTransferLimit !== '0') {
updateData['softTransferLimit'] = softTransferLimit;
}

try {
await this.aggregationService.updateLnBridgeRelayInfo({
where: { id: id },
data: {
heartbeatTimestamp: Math.floor(Date.now() / 1000),
softTransferLimit: softTransferLimit ?? '0',
},
data: updateData,
});
} catch (e) {
console.log(`heart beat failed ${id}, exception: ${e}`);
Expand Down

0 comments on commit c5f24dc

Please sign in to comment.