add caching, add to stats
This commit is contained in:
1 parent
ab3297acfb
commit
dfd2c2f07d
5 files changed
+62
-6
No files matched your search
+3
-1
@@ -67,10 +67,11 @@ async def get_stats():
|
||||
"""
|
||||
Get daily statistics for LEGO inventory.
|
||||
|
||||
Returns metrics about enrichment progress, missing data, and catalog value.
|
||||
Returns metrics about enrichment progress, missing data, catalog value, and cache stats.
|
||||
"""
|
||||
try:
|
||||
daily_stats = await stats.get_daily_stats()
|
||||
cache_stats = await stats.get_brickset_cache_stats()
|
||||
|
||||
# Calculate completion percentage
|
||||
if daily_stats["total_items"] > 0:
|
||||
@@ -84,6 +85,7 @@ async def get_stats():
|
||||
"status": "success",
|
||||
"stats": daily_stats,
|
||||
"completion_rate": round(completion_rate, 1),
|
||||
"brickset_cache": cache_stats,
|
||||
}
|
||||
except Exception as e:
|
||||
return JSONResponse(
|
||||
|
||||
Reference in new issue
Block a user