Add pending_anchors count to anchor stats
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
4
db.py
4
db.py
@@ -689,6 +689,9 @@ async def get_anchor_stats() -> dict:
|
|||||||
confirmed_anchors = await conn.fetchval(
|
confirmed_anchors = await conn.fetchval(
|
||||||
"SELECT COUNT(*) FROM anchors WHERE confirmed_at IS NOT NULL"
|
"SELECT COUNT(*) FROM anchors WHERE confirmed_at IS NOT NULL"
|
||||||
)
|
)
|
||||||
|
pending_anchors = await conn.fetchval(
|
||||||
|
"SELECT COUNT(*) FROM anchors WHERE confirmed_at IS NULL"
|
||||||
|
)
|
||||||
anchored_activities = await conn.fetchval(
|
anchored_activities = await conn.fetchval(
|
||||||
"SELECT COUNT(*) FROM activities WHERE anchor_root IS NOT NULL"
|
"SELECT COUNT(*) FROM activities WHERE anchor_root IS NOT NULL"
|
||||||
)
|
)
|
||||||
@@ -698,6 +701,7 @@ async def get_anchor_stats() -> dict:
|
|||||||
return {
|
return {
|
||||||
"total_anchors": total_anchors,
|
"total_anchors": total_anchors,
|
||||||
"confirmed_anchors": confirmed_anchors,
|
"confirmed_anchors": confirmed_anchors,
|
||||||
|
"pending_anchors": pending_anchors,
|
||||||
"anchored_activities": anchored_activities,
|
"anchored_activities": anchored_activities,
|
||||||
"unanchored_activities": unanchored_activities
|
"unanchored_activities": unanchored_activities
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user