diff --git a/check_environment.py b/check_environment.py index 1443a7f..c99ccdd 100644 --- a/check_environment.py +++ b/check_environment.py @@ -25,12 +25,20 @@ async def main(): namespaces = ["weather", "air_quality", "forecast", "sun", "news"] + now_ms = int(time.time() * 1000) + for ns in namespaces: try: + from qdrant_client.models import Range + + # Filter by namespace AND not expired results = qdrant.scroll( collection_name=collection, scroll_filter=Filter( - must=[FieldCondition(key="namespace", match=MatchValue(value=ns))] + must=[ + FieldCondition(key="namespace", match=MatchValue(value=ns)), + FieldCondition(key="ttl_expiry", range=Range(gt=now_ms)), + ] ), limit=10, with_payload=True, @@ -38,7 +46,7 @@ async def main(): ) points = results[0] - print(f"=== {ns.upper()} ({len(points)} records) ===") + print(f"=== {ns.upper()} [namespace:{ns}] ({len(points)} records) ===") if not points: print(" (no data)")