A new tokio task that gets the last seen block height, and attempts to index the blocks since now.
Also have another task that will periodically fix gaps in the data (also have a time limit for finding when the gap occurred):
Example gap finder query:
select time, height + 1 as gap_start,
next_nr - 1 as gap_end
from (
select time, height,
lead(height) over (order by height) as next_nr
from block
) nr
where height + 1 <> next_nr;
Requirements
Example gap finder query: