fix: adjust expires_at check to allow for a 60-second buffer

pull/22744/head
Yeuoly 9 months ago
parent 20ca2033ce
commit fe1a3ca943

@ -252,7 +252,7 @@ class ToolManager:
decrypted_credentials: Mapping[str, Any] = encrypter.decrypt(builtin_provider.credentials)
# check if the credentials is expired
if builtin_provider.expires_at != -1 and builtin_provider.expires_at < int(time.time()):
if builtin_provider.expires_at != -1 and (builtin_provider.expires_at - 60) < int(time.time()):
# TODO: circular import
from services.tools.builtin_tools_manage_service import BuiltinToolManageService

Loading…
Cancel
Save