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

Method enable_token

src/services/token_manager.py:258–263  ·  view source on GitHub ↗

Enable a token and reset error count

(self, token_id: int)

Source from the content-addressed store, hash-verified

256 debug_logger.log_warning(f"[DELETE_TOKEN] 清理 personal 浏览器状态失败: {e}")
257
258 async def enable_token(self, token_id: int):
259 """Enable a token and reset error count"""
260 # Enable the token
261 await self.db.update_token(token_id, is_active=True, ban_reason=None, banned_at=None)
262 # Reset error count when enabling (only reset total error_count, keep today_error_count)
263 await self.db.reset_error_count(token_id)
264
265 async def disable_token(self, token_id: int):
266 """Disable a token"""

Callers 2

enable_tokenFunction · 0.80
plugin_update_tokenFunction · 0.80

Calls 2

reset_error_countMethod · 0.80
update_tokenMethod · 0.45

Tested by

no test coverage detected