Skip to content

Commit

Permalink
logs
Browse files Browse the repository at this point in the history
  • Loading branch information
wsdt committed Mar 2, 2024
1 parent ec3d983 commit 8a54cfc
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -467,18 +467,23 @@ export class LightBridgeService extends BaseService<TeleportationOptions> {
disbursement: d,
sourceChain: d.sourceChainId,
nextDepositIds,
depositIdLoaded: d.sourceChainId in nextDepositIds,
depositIdLoaded2: nextDepositIds[d.sourceChainId],
})
if (!nextDepositIds[d.sourceChainId]) {
if (!(d.sourceChainId in nextDepositIds)) {
// load into mapping if not yet done
this.logger.info(`nextDepositId not yet loaded for sourceChainId: `, {sourceChainId: d.sourceChainId})
nextDepositIds[d.sourceChainId] =
await this.state.Teleportation.totalDisbursements(d.sourceChainId)
}
this.logger.info(`Filter iteration END: next deposit id: `, {nextDepositIds, sourceChainId: d.sourceChainId})
// only try to disburse those who haven't been disbursed from a previous service already before DB state got lost
return d.depositId >= nextDepositIds[d.sourceChainId]
})
this.logger.info(`Filtered disbursements for db recovery: `, {
disbursements,
nextDepositIdsKeys: Object.keys(nextDepositIds),
nextDepositIds,
})

for (const sourceChainId of Object.keys(nextDepositIds)) {
Expand Down

0 comments on commit 8a54cfc

Please sign in to comment.