MCPcopy Create free account
hub / github.com/TheSmallHanCat/flow2api / get_token_stats

Method get_token_stats

src/core/database.py:1211–1219  ·  view source on GitHub ↗

Get token statistics

(self, token_id: int)

Source from the content-addressed store, hash-verified

1209 await self.increment_error_count(token_id)
1210
1211 async def get_token_stats(self, token_id: int) -> Optional[TokenStats]:
1212 """Get token statistics"""
1213 async with self._connect() as db:
1214 db.row_factory = aiosqlite.Row
1215 cursor = await db.execute("SELECT * FROM token_stats WHERE token_id = ?", (token_id,))
1216 row = await cursor.fetchone()
1217 if row:
1218 return TokenStats(**dict(row))
1219 return None
1220
1221 async def increment_image_count(self, token_id: int):
1222 """Increment image generation count with daily reset"""

Callers 1

record_errorMethod · 0.80

Calls 2

_connectMethod · 0.95
TokenStatsClass · 0.85

Tested by

no test coverage detected