parent
2816cf8bfe
commit
6d8b3c4bf2
|
@ -152,12 +152,23 @@ export class PollSolanaTransactions extends RunPollingJob {
|
|||
): Promise<solana.Block> {
|
||||
const blockResult = await this.slotRepository.getBlock(slot, this.cfg.commitment);
|
||||
if (blockResult.isOk()) {
|
||||
return Promise.resolve(blockResult.getValue());
|
||||
const block = blockResult.getValue();
|
||||
if (block.transactions.length > 0) {
|
||||
return block;
|
||||
}
|
||||
const next = nextSlot(slot);
|
||||
this.logger.warn(
|
||||
`[findValidBlock] No transactions found for slot ${slot}, trying next slot ${next}`
|
||||
);
|
||||
return this.findValidBlock(next, nextSlot);
|
||||
}
|
||||
|
||||
if (blockResult.getError().skippedSlot() || blockResult.getError().noBlockOrBlockTime()) {
|
||||
this.logger.warn(`No block found for slot ${slot}, trying next slot ${nextSlot(slot)}`);
|
||||
return this.findValidBlock(nextSlot(slot), nextSlot);
|
||||
const next = nextSlot(slot);
|
||||
this.logger.warn(
|
||||
`[findValidBlock] No block found for slot ${slot}, trying next slot ${next}`
|
||||
);
|
||||
return this.findValidBlock(next, nextSlot);
|
||||
}
|
||||
|
||||
throw blockResult.getError();
|
||||
|
|
|
@ -24,7 +24,7 @@ export class SnsEventRepository {
|
|||
|
||||
async publish(events: LogFoundEvent<any>[]): Promise<SnsPublishResult> {
|
||||
if (!events.length) {
|
||||
this.logger.warn("[publish] No events to publish, continuing...");
|
||||
this.logger.debug("[publish] No events to publish, continuing...");
|
||||
return {
|
||||
status: "success",
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue