Reset consecutive error count (only reset consecutive_error_count, keep error_count and today_error_count) This is called when: - Token is manually enabled by admin - Request succeeds (resets consecutive error counter) Note: error_count (total historical errors) is
(self, token_id: int)
| 1319 | await db.commit() |
| 1320 | |
| 1321 | async def reset_error_count(self, token_id: int): |
| 1322 | """Reset consecutive error count (only reset consecutive_error_count, keep error_count and today_error_count) |
| 1323 | |
| 1324 | This is called when: |
| 1325 | - Token is manually enabled by admin |
| 1326 | - Request succeeds (resets consecutive error counter) |
| 1327 | |
| 1328 | Note: error_count (total historical errors) is NEVER reset |
| 1329 | """ |
| 1330 | async with self._connect(write=True) as db: |
| 1331 | await db.execute(""" |
| 1332 | UPDATE token_stats SET consecutive_error_count = 0 WHERE token_id = ? |
| 1333 | """, (token_id,)) |
| 1334 | await db.commit() |
| 1335 | |
| 1336 | # Config operations |
| 1337 | async def get_admin_config(self) -> Optional[AdminConfig]: |
no test coverage detected