Get token statistics
(self, token_id: int)
| 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""" |
no test coverage detected