If no new events occur between iterations of the contract subscriber loop, it will process the same block over and over again.
|
let fromBlock = await getAsync('currentBlock') || 0; |
|
let events = await StandardBounties.getPastEvents({fromBlock, toBlock: 'latest'}); |
|
let eventBlock = await sendEvents(events); |
|
|
|
if (eventBlock) { |
|
await writeAsync('currentBlock', eventBlock); |
|
} |
I think that eventBlock should be incremented by 1 before updating the currentBlock in the Redis cache. This is a minor issue since messageDeduplicationId should stop it from actually getting processed, however it seems like it puts unnecessary strain on the cache.
If no new events occur between iterations of the contract subscriber loop, it will process the same block over and over again.
BountiesAPI/contract_subscriber/index.js
Lines 15 to 21 in fa40025
I think that
eventBlockshould be incremented by 1 before updating thecurrentBlockin the Redis cache. This is a minor issue sincemessageDeduplicationIdshould stop it from actually getting processed, however it seems like it puts unnecessary strain on the cache.