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

Method needs_at_refresh

src/services/token_manager.py:516–520  ·  view source on GitHub ↗

供调度层快速判断当前 token 是否大概率会触发 AT 刷新。

(self, token: Optional[Token])

Source from the content-addressed store, hash-verified

514 return False
515
516 def needs_at_refresh(self, token: Optional[Token]) -> bool:
517 """供调度层快速判断当前 token 是否大概率会触发 AT 刷新。"""
518 if not token:
519 return True
520 return self._should_refresh_at(token)
521
522 async def ensure_valid_token(self, token: Optional[Token]) -> Optional[Token]:
523 """确保 token 的 AT 可用,并在必要时返回刷新后的最新对象。"""

Callers 2

select_tokenMethod · 0.80
plugin_check_tokensFunction · 0.80

Calls 1

_should_refresh_atMethod · 0.95

Tested by

no test coverage detected