Stuck at 99% indexing

I have noticed my explorer is indexed but always missing one or two blocks because they are always being mined so the warning shows at the top:

99% Blocks Indexed - We’re indexing this chain right now. Some of the counts may be inaccurate.

I am trying to find an ENV var that will make it so it only shows the warning if it is behind by more than X number of blocks…

Closest I have found is LAST_BLOCK but the block height is always changing… Can I put something like minus 2 here to say blockheight minus 2?

Or is that the wrong setting and will stop indexing all together even when new blocks are mined?

Thanks :slight_smile:

What you can do in that case, you can re-define finished_indexing? function:

In order to hide the warning, this function should return true. As a temporary solution you can do like this:

def finished_indexing? do

Meanwhile, we should more properly handle indexing status in this function excluding from considerations the last X blocks as you mentioned.

1 Like

Yes if we could look at that function in future blockscout releases, it should end up making it into the forks down the line at some point.

I will make that patching now, thanks!