Skip to content

Commit 1c65e9c

Browse files
authored
core block diff health check (#11365)
1 parent d03ff55 commit 1c65e9c

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

packages/discovery-provider/src/queries/get_health.py

+9-1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
from src.queries.get_sol_plays import get_sol_play_health_info
2323
from src.queries.get_trusted_notifier_discrepancies import get_delist_statuses_ok
2424
from src.tasks.index_core import (
25+
CoreHealth,
2526
core_health_check_cache_key,
2627
core_listens_health_check_cache_key,
2728
)
@@ -263,7 +264,7 @@ def get_health(args: GetHealthArgs, use_redis_cache: bool = True) -> Tuple[Dict,
263264
latest_indexed_block_num = db_block_state["number"] or 0
264265
latest_indexed_block_hash = db_block_state["blockhash"]
265266

266-
core_health = get_core_health(redis=redis)
267+
core_health: CoreHealth = get_core_health(redis=redis)
267268
core_listens_health = get_core_listens_health(
268269
redis=redis, plays_count_max_drift=plays_count_max_drift
269270
)
@@ -273,6 +274,13 @@ def get_health(args: GetHealthArgs, use_redis_cache: bool = True) -> Tuple[Dict,
273274
if indexing_plays_with_core:
274275
play_health_info = core_listens_health
275276

277+
indexing_entity_manager_with_core = core_health and core_health.get(
278+
"indexing_entity_manager"
279+
)
280+
if indexing_entity_manager_with_core:
281+
latest_indexed_block_num = core_health.get("latest_indexed_block") or -1
282+
latest_block_num = core_health.get("latest_chain_block") or -1
283+
276284
user_bank_health_info = get_solana_indexer_status(
277285
redis, redis_keys.solana.user_bank, user_bank_max_drift
278286
)

0 commit comments

Comments
 (0)