这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@Lazar955
Copy link
Member

@Lazar955 Lazar955 commented Jan 10, 2025

closes #264

}
select {
case <-time.After(cp.cfg.PollInterval):
case <-ticker.C:
Copy link
Member Author

@Lazar955 Lazar955 Jan 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we use a ticker for long-running loops, as time.After creates a new instance every iteration that needs to be garbage-collected

}

func (cp *ChainPoller) setNextHeight(height uint64) {
cp.mu.Lock()
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if we run the unit tests with -race, we have a race condition, need a mutex for this

@Lazar955 Lazar955 requested a review from gitferry January 15, 2025 13:23
@Lazar955 Lazar955 marked this pull request as ready for review January 15, 2025 13:23
Copy link
Member

@gitferry gitferry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work! Two comments:

@Lazar955 Lazar955 requested a review from gitferry January 16, 2025 13:55
Copy link
Member

@gitferry gitferry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work!

@Lazar955 Lazar955 merged commit d506aa9 into main Jan 17, 2025
12 checks passed
@Lazar955 Lazar955 deleted the lazar/improve-poller branch January 17, 2025 10:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improve poller to poll batch of blocks at once

3 participants