Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: warning for waiting too long for the next block #50

Merged

Conversation

keroro520
Copy link
Contributor

Prints warning logs when ckb-indexer has been too long since the last update of new blocks.

@keroro520
Copy link
Contributor Author

Initially, I think a warning log is enough. But I found that the default log filter of env-logger is "error", which means warning logs are invisible by default. So I change to use "error" logl-evel.

src/service.rs Outdated
{
if let Ok(ckb_tip_header) = get_tip_header(&rpc_client).await {
error!(
"ckb-indexer has been {}s since the last update, ckb.tip_number = {}, ckb.tip_hash = {:#x}, indexer.tip_number = {}, indexer.tip_hash = {:#x}",
Copy link
Member

Choose a reason for hiding this comment

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

this error message ckb-indexer has been 60s since the last update, doesn't read like a complete sentence

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Force push 5b467ca updates:

  • rewrite "ckb-indexer has been 60s since the last update" to "it has been 60s since the last update"

@keroro520 keroro520 force-pushed the warn-for-no-update-for-long-time branch from b3e6b00 to 5b467ca Compare May 27, 2022 09:09
@quake quake merged commit 84f044f into nervosnetwork:master May 27, 2022
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.

2 participants