From c4be5a8099843ce0dca0b9ba5df82b367d2dd21a Mon Sep 17 00:00:00 2001 From: user Date: Sun, 10 Mar 2024 14:29:46 +0300 Subject: [PATCH] dev@locazia: fix indexer --- app/api/routes/_system.py | 2 +- app/core/background/indexer_service.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/api/routes/_system.py b/app/api/routes/_system.py index 9e6b1f2..5727452 100644 --- a/app/api/routes/_system.py +++ b/app/api/routes/_system.py @@ -20,7 +20,7 @@ def get_git_info(): async def s_api_v1_node(request): # /api/v1/node last_known_index = request.ctx.db_session.query(StoredContent).filter( - StoredContent.type == "onchain/content" + StoredContent.onchain_index != None ).order_by(StoredContent.onchain_index.desc()).first() last_known_index = last_known_index.onchain_index if last_known_index else 0 last_known_index = max(last_known_index, 0) diff --git a/app/core/background/indexer_service.py b/app/core/background/indexer_service.py index 8e8ffe8..03a14f1 100644 --- a/app/core/background/indexer_service.py +++ b/app/core/background/indexer_service.py @@ -42,7 +42,7 @@ async def indexer_loop(memory, platform_found: bool, seqno: int) -> [bool, int]: session.commit() last_known_index = session.query(StoredContent).filter( - StoredContent.type == "onchain/content" + StoredContent.onchain_index != None ).order_by(StoredContent.onchain_index.desc()).first() last_known_index = last_known_index.onchain_index if last_known_index else 0 last_known_index = max(last_known_index, 0)