-
Notifications
You must be signed in to change notification settings - Fork 27
Open
Description
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
| 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.
Metadata
Metadata
Assignees
Labels
No labels