mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-31 17:55:01 +00:00
refactor: Update OpenRouter OAuth flow timeout to 5 minutes
This commit is contained in:
parent
477f9eb4ec
commit
3f3b1fb657
1 changed files with 3 additions and 3 deletions
|
@ -288,8 +288,8 @@ def start_openrouter_oauth_flow(io, analytics):
|
||||||
io.tool_output()
|
io.tool_output()
|
||||||
print(auth_url)
|
print(auth_url)
|
||||||
|
|
||||||
MINUTES=5 # ai!
|
MINUTES = 5
|
||||||
io.tool_output("\nWaiting for authentication... (Timeout: 2 minutes)")
|
io.tool_output(f"\nWaiting for authentication... (Timeout: {MINUTES} minutes)")
|
||||||
|
|
||||||
try:
|
try:
|
||||||
webbrowser.open(auth_url)
|
webbrowser.open(auth_url)
|
||||||
|
@ -300,7 +300,7 @@ def start_openrouter_oauth_flow(io, analytics):
|
||||||
# Wait for the callback to set the auth_code or for timeout/error
|
# Wait for the callback to set the auth_code or for timeout/error
|
||||||
interrupted = False
|
interrupted = False
|
||||||
try:
|
try:
|
||||||
shutdown_server.wait(timeout=120) # 2 minute timeout
|
shutdown_server.wait(timeout=MINUTES * 60) # Convert minutes to seconds
|
||||||
except KeyboardInterrupt:
|
except KeyboardInterrupt:
|
||||||
io.tool_warning("\nOAuth flow interrupted by user.")
|
io.tool_warning("\nOAuth flow interrupted by user.")
|
||||||
analytics.event("oauth_flow_failed", provider="openrouter", reason="user_interrupt")
|
analytics.event("oauth_flow_failed", provider="openrouter", reason="user_interrupt")
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue