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

Method reset_error_count

src/core/database.py:1321–1334  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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]:

Callers 3

enable_tokenMethod · 0.80
record_successMethod · 0.80
auto_unban_429_tokensMethod · 0.80

Calls 1

_connectMethod · 0.95

Tested by

no test coverage detected